From 43e57a42832ea8b4ceb0317f3c9028a4174ffa7b Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 8 Aug 2007 07:25:32 +0000 Subject: Adapted project directory structure to suit the new maven based build process. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@909 d688527b-c9ab-4aba-bd8d-4036d912da1d --- id/oa/src/main/webapp/stateful_login.jsp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 id/oa/src/main/webapp/stateful_login.jsp (limited to 'id/oa/src/main/webapp/stateful_login.jsp') diff --git a/id/oa/src/main/webapp/stateful_login.jsp b/id/oa/src/main/webapp/stateful_login.jsp new file mode 100644 index 000000000..eaede507f --- /dev/null +++ b/id/oa/src/main/webapp/stateful_login.jsp @@ -0,0 +1,29 @@ +<%@ page import="javax.servlet.http.*" %> +<% + /* check request's remote IP address - must be moa-id-proxy's address */ + String remoteIPAddress = request.getRemoteAddr(); + if (! "127.0.0.1".equals(remoteIPAddress)) { /* Substitute "127.0.0.1" for moa-id-proxy's IP address */ + response.setStatus(403); + return; + } + + /* store authentication data in cookies */ + String fn = request.getParameter("FamilyName"); + String gn = request.getParameter("GivenName"); + /* set cookie domain and cookie path ! */ + String cookieDomain = ".test.test"; /* Set this to the common domain of moa-id-proxy and of the online application */ + String cookiePath = request.getContextPath(); /* Set this to the context path of the online application */ + + Cookie cfn = new Cookie("familyname", fn); + cfn.setDomain(cookieDomain); + cfn.setPath(cookiePath); + response.addCookie(cfn); + + Cookie cgn = new Cookie("givenname", gn); + cgn.setDomain(cookieDomain); + cgn.setPath(cookiePath); + response.addCookie(cgn); + + /* redirect to online application's start page */ + response.sendRedirect("http://oa.test.test:8080/oa/index.jsp"); /* Substitute for URL in online application */ +%> -- cgit v1.2.3