From 59f78a67d7357fd31de68fc2b623f95b3d654ebc Mon Sep 17 00:00:00 2001 From: rudolf Date: Fri, 24 Oct 2003 08:18:40 +0000 Subject: MOA-ID version 1.1 (initial) git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@18 d688527b-c9ab-4aba-bd8d-4036d912da1d --- id.oa/.classpath | 6 ++++ id.oa/.project | 23 +++++++++++++++ id.oa/build.xml | 32 +++++++++++++++++++++ id.oa/html/AuthTemplate.jsp | 30 ++++++++++++++++++++ id.oa/html/BKUSelectionTemplate.jsp | 14 ++++++++++ id.oa/html/auth.jsp | 48 +++++++++++++++++++++++++++++++ id.oa/html/chooseBKU.jsp | 19 +++++++++++++ id.oa/html/form.jsp | 20 +++++++++++++ id.oa/html/getBKUSelectTag.jsp | 6 ++++ id.oa/html/index.jsp | 56 +++++++++++++++++++++++++++++++++++++ id.oa/html/stateful_login.jsp | 29 +++++++++++++++++++ id.oa/web.xml | 9 ++++++ 12 files changed, 292 insertions(+) create mode 100644 id.oa/.classpath create mode 100644 id.oa/.project create mode 100644 id.oa/build.xml create mode 100644 id.oa/html/AuthTemplate.jsp create mode 100644 id.oa/html/BKUSelectionTemplate.jsp create mode 100644 id.oa/html/auth.jsp create mode 100644 id.oa/html/chooseBKU.jsp create mode 100644 id.oa/html/form.jsp create mode 100644 id.oa/html/getBKUSelectTag.jsp create mode 100644 id.oa/html/index.jsp create mode 100644 id.oa/html/stateful_login.jsp create mode 100644 id.oa/web.xml (limited to 'id.oa') diff --git a/id.oa/.classpath b/id.oa/.classpath new file mode 100644 index 000000000..5af765a17 --- /dev/null +++ b/id.oa/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/id.oa/.project b/id.oa/.project new file mode 100644 index 000000000..e49130a5f --- /dev/null +++ b/id.oa/.project @@ -0,0 +1,23 @@ + + + id.oa + + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.ibm.etools.ctc.serviceprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + com.ibm.etools.ctc.javaprojectnature + + diff --git a/id.oa/build.xml b/id.oa/build.xml new file mode 100644 index 000000000..adb191e76 --- /dev/null +++ b/id.oa/build.xml @@ -0,0 +1,32 @@ + + + + + + + + + + Time (hhmm): ${TSTAMP} + + + + + + + + + + + + + + + + diff --git a/id.oa/html/AuthTemplate.jsp b/id.oa/html/AuthTemplate.jsp new file mode 100644 index 000000000..1fa0d1ef8 --- /dev/null +++ b/id.oa/html/AuthTemplate.jsp @@ -0,0 +1,30 @@ + + +MOA ID Auth Sample Login - customized + + +

MOA ID Auth Sample Login - customized

+
+ + + +
+
+ + + Hier finden Sie weitere Informationen zur Überprüfung der Zertifikate. + +
+ \ No newline at end of file diff --git a/id.oa/html/BKUSelectionTemplate.jsp b/id.oa/html/BKUSelectionTemplate.jsp new file mode 100644 index 000000000..82c8518e9 --- /dev/null +++ b/id.oa/html/BKUSelectionTemplate.jsp @@ -0,0 +1,14 @@ + + +BKU Auswahl - customized + + +

BKU Auswahl - customized

+

+

+ + + +

+ + \ No newline at end of file diff --git a/id.oa/html/auth.jsp b/id.oa/html/auth.jsp new file mode 100644 index 000000000..0b563a83e --- /dev/null +++ b/id.oa/html/auth.jsp @@ -0,0 +1,48 @@ + + +MOA ID Auth Sample Login + + +<% /** assumes moa-id-auth and oa in the same servlet container, + and moa-id-proxy on a different fixed location */ + String authUrlPath = + request.getScheme() + "://" + + request.getServerName() + ":" + request.getServerPort() + + "/moa-id-auth/"; + String proxyUrlPath = "http://10.16.126.28:9080/moa-id-proxy/"; + String oaUrlPath = + request.getScheme() + "://" + + request.getServerName() + ":" + request.getServerPort() + + "/oa/"; + String params = + "Target=gb&" + + "OA=" + proxyUrlPath + "index.jsp"; + String urlStartAuth = + authUrlPath + + "StartAuthentication?" + + params; + String templateParam = + "&Template=" + oaUrlPath + "AuthTemplate.jsp"; + String urlStartAuthCustom = + urlStartAuth + + templateParam; + String urlSelectBKU = + authUrlPath + + "SelectBKU?" + + params; + String urlSelectBKUCustom = + urlSelectBKU + + templateParam + + "&BKUSelectionTemplate=" + oaUrlPath + "BKUSelectionTemplate.jsp"; +%> +Log in to sample application +
+Log in to sample application using custom form +
+Choose BKU (HTMLComplete or HTMLSelect) and log in +
+Choose BKU (HTMLSelect) using custom form and log in +
+">Wrong parameters example + + \ No newline at end of file diff --git a/id.oa/html/chooseBKU.jsp b/id.oa/html/chooseBKU.jsp new file mode 100644 index 000000000..0135b6fdf --- /dev/null +++ b/id.oa/html/chooseBKU.jsp @@ -0,0 +1,19 @@ + + +BKU Auswahl + + +

BKU Auswahl

+

+

"> + + +
+

+ + \ No newline at end of file diff --git a/id.oa/html/form.jsp b/id.oa/html/form.jsp new file mode 100644 index 000000000..d439fa84d --- /dev/null +++ b/id.oa/html/form.jsp @@ -0,0 +1,20 @@ +<%@ page import="java.util.*" %> + + +Sample Online Application + + +

Sample Form

+

+

+<% String param1 = request.getParameter("param1"); + if (param1 == null) param1 = ""; %> +Input some text: + +
Previous text input: <%=param1%>
+ +
+

+

Back

+ + \ No newline at end of file diff --git a/id.oa/html/getBKUSelectTag.jsp b/id.oa/html/getBKUSelectTag.jsp new file mode 100644 index 000000000..028dbd348 --- /dev/null +++ b/id.oa/html/getBKUSelectTag.jsp @@ -0,0 +1,6 @@ + diff --git a/id.oa/html/index.jsp b/id.oa/html/index.jsp new file mode 100644 index 000000000..5111e5103 --- /dev/null +++ b/id.oa/html/index.jsp @@ -0,0 +1,56 @@ +<%@ page import="java.util.*,javax.servlet.http.*,sun.misc.BASE64Decoder" %> + + +Sample Online Application + + +

Sample Online Application

+ +

Request headers: + + <% + /* collect parameters from request */ + for (Enumeration enum = request.getHeaderNames(); enum.hasMoreElements(); ) { + String key = (String) enum.nextElement(); + String value = request.getHeader(key); %> + + <% } %> +
<%=key%><%=value%>
+

+ +

Request parameters: + + <% + /* collect parameters from request */ + for (Enumeration enum = request.getParameterNames(); enum.hasMoreElements(); ) { + String name = (String) enum.nextElement(); + String value = request.getParameter(name); %> + + <% } %> +
<%=name%><%=value%>
+

+ +

Cookies: + + <% + /* collect attributes from request */ + Cookie[] cookies = request.getCookies(); + if (cookies != null) { + for (int i = 0; i < cookies.length; i++) { + Cookie cookie = cookies[i]; %> + + <% } + } %> +
<%=cookie.getName()%><%=cookie.getValue()%>
+

+ +<% String authHeader = request.getHeader("Authorization"); + if (authHeader != null) { + authHeader = authHeader.substring(authHeader.indexOf(" ")+1); + String decAuthHeader = new String(new BASE64Decoder().decodeBuffer(authHeader)); +%> +

Basic authentication credentials: <%=decAuthHeader%>

+<% } %> +

Form sample

+ + \ No newline at end of file diff --git a/id.oa/html/stateful_login.jsp b/id.oa/html/stateful_login.jsp new file mode 100644 index 000000000..eaede507f --- /dev/null +++ b/id.oa/html/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 */ +%> diff --git a/id.oa/web.xml b/id.oa/web.xml new file mode 100644 index 000000000..13158fdaa --- /dev/null +++ b/id.oa/web.xml @@ -0,0 +1,9 @@ + + + + + + Sample OA + MOA Sample OA + + -- cgit v1.2.3