From cea2f395ec773b386ec628d60120752cf320f6b6 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 27 Jan 2014 16:27:02 +0100 Subject: add PVP2 Demo Application change SZRGWClient to JAXWs --- id/oa/src/main/webapp/WEB-INF/web.xml | 36 +++++- id/oa/src/main/webapp/auth.jsp | 48 ------- id/oa/src/main/webapp/chooseBKU.jsp | 19 --- id/oa/src/main/webapp/css/index.css | 205 ++++++++++++++++++++++++++++++ id/oa/src/main/webapp/demoapp.jsp | 73 +++++++++++ id/oa/src/main/webapp/form.jsp | 20 --- id/oa/src/main/webapp/getBKUSelectTag.jsp | 6 - id/oa/src/main/webapp/index.jsp | 60 --------- id/oa/src/main/webapp/js/common.js | 32 +++++ id/oa/src/main/webapp/stateful_login.jsp | 29 ----- 10 files changed, 345 insertions(+), 183 deletions(-) delete mode 100644 id/oa/src/main/webapp/auth.jsp delete mode 100644 id/oa/src/main/webapp/chooseBKU.jsp create mode 100644 id/oa/src/main/webapp/css/index.css create mode 100644 id/oa/src/main/webapp/demoapp.jsp delete mode 100644 id/oa/src/main/webapp/form.jsp delete mode 100644 id/oa/src/main/webapp/getBKUSelectTag.jsp delete mode 100644 id/oa/src/main/webapp/index.jsp create mode 100644 id/oa/src/main/webapp/js/common.js delete mode 100644 id/oa/src/main/webapp/stateful_login.jsp (limited to 'id/oa/src/main/webapp') diff --git a/id/oa/src/main/webapp/WEB-INF/web.xml b/id/oa/src/main/webapp/WEB-INF/web.xml index 13158fdaa..85a1bbaeb 100644 --- a/id/oa/src/main/webapp/WEB-INF/web.xml +++ b/id/oa/src/main/webapp/WEB-INF/web.xml @@ -4,6 +4,40 @@ Sample OA - MOA Sample OA + MOA PVP2.1 Sample OA + + + pvp2login + pvp2login + at.gv.egovernment.moa.id.demoOA.servlet.pvp2.Authenticate + + + + pvp2login + /servlet/pvp2login + + + + pvp2metadata + Metadata + at.gv.egovernment.moa.id.demoOA.servlet.pvp2.BuildMetadata + + + + pvp2metadata + /servlet/metadata + + + + pvp2demooa + Secure area + at.gv.egovernment.moa.id.demoOA.servlet.pvp2.DemoApplication + + + + pvp2demooa + /demoapplication + + diff --git a/id/oa/src/main/webapp/auth.jsp b/id/oa/src/main/webapp/auth.jsp deleted file mode 100644 index 0b563a83e..000000000 --- a/id/oa/src/main/webapp/auth.jsp +++ /dev/null @@ -1,48 +0,0 @@ - - -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/src/main/webapp/chooseBKU.jsp b/id/oa/src/main/webapp/chooseBKU.jsp deleted file mode 100644 index 0135b6fdf..000000000 --- a/id/oa/src/main/webapp/chooseBKU.jsp +++ /dev/null @@ -1,19 +0,0 @@ - - -BKU Auswahl - - -

BKU Auswahl

-

-

"> - - -
-

- - \ No newline at end of file diff --git a/id/oa/src/main/webapp/css/index.css b/id/oa/src/main/webapp/css/index.css new file mode 100644 index 000000000..6ff99af63 --- /dev/null +++ b/id/oa/src/main/webapp/css/index.css @@ -0,0 +1,205 @@ +@charset "utf-8"; + +h2#demonstrator_tabheader, h2#demonstrator_contentheader { + padding:2px; + font-size:1.1em; + color:#fff; + border-bottom:2px solid #fff; +} + +#demonstrator_centercontent { + width:auto; + +} + +#demonstrator_content { + padding:20px; +} + +#demonstrator_content a { + text-decoration:underline; + color: #000; +} + +.logoutbuttons { + margin-bottom: 5px; + margin-top: 0; +} + +p { + margin-bottom:1em; +} + + +/* [OPTIONAL] Geben Sie hier die Farbe fuer den hellen Hintergrund an */ +.demonstrator_hell { + background-color : #DDDDDD; +} + +/* [OPTIONAL] Geben Sie hier die Farbe fuer den dunklen Hintergrund an */ +.demonstrator_dunkel { + background-color: #A02D2D; +} + +.demonstrator_logoutButton { + position: relative; + margin-left: 65%; + bottom: 15px; +} + +.demonstrator_button { +/* background: #efefef; + border:2px solid #000; */ + cursor: pointer; + width: 180px; + height: 25px; + text-align: center; + margin-bottom: 10px; + margin-top: 25px; + border-radius: 5px; + padding-top: 5px; + padding-bottom: 5px; +} + +#demonstrator_SAML-assertion { + display: none; +} + +#demonstrator_samlArea{ + width: 100%; +} + +/* Anmeldeframe */ +#demonstrator_main { + clear:both; +} + +#demonstrator_leftcontent { + /*float:left;*/ +/* width:255px; */ + margin-left: 40%; + position: relative; +/* margin: 0 auto; */ +} + +#submitbutton { + width: 150px; +} + +h2#demonstrator_tabheader, h2#demonstrator_contentheader { + padding:2px; + font-size:1.1em; + color:#fff; + border-bottom:2px solid #fff; +} + +#demonstrator_bkulogin { + overflow:hidden; +} + +#demonstrator_bkukarte { + float:left; + background: url(../img/karte.gif) no-repeat top center; + padding: 90px 10px 10px 10px; + text-align:center; + width:40%; +} + +#demonstrator_bkuhandy { + float:right; + background: url(../img/handy.gif) no-repeat top center; + padding: 90px 10px 10px 10px; + text-align:center; + width:40%; +} + +#demonstrator_mandate{ + text-align:center; + padding : 5px 5px 5px 5px; + clear: both; +} + +#demonstrator_stork{ + text-align:center; + padding-top: 5px; + padding-bottom: 5px; + clear: both; +} + +/* .demonstrator_button input { + background: #efefef; + border:1px solid #000; + cursor: pointer; +} */ + +#demonstrator_installJava, #demonstrator_BrowserNOK { + clear:both; + font-size:0.8em; + padding:4px; +} + +#demonstrator_localBKU { + padding:4px; +} + +#demonstrator_localBKU p{ + text-align: left; +} + +.demonstrator_sendButton { + background-color: DarkGray; + border-style: solid; + border-width: 1px; + border-color: black; +} + +#demonstrator_tab { + margin-top:2px; + padding:2px; + clear:both; +} + +#demonstrator_leftcontent a { + text-decoration:none; + color: #000; +/* display:block;*/ + padding:4px; +} + +#demonstrator_leftcontent a:hover, #demonstrator_leftcontent a:focus, #demonstrator_leftcontent a:active { + text-decoration:underline; + color: #000; +} + +#demonstrator_navlist { + margin-top:20px; +} + +#demonstrator_navlist ul { + list-style: none; + margin-left: 0; +} + +#demonstrator_navlist li { + border-bottom:1px solid #fff; +} + +/* iframe { + width:250px; +} */ + +.demonstrator_infobutton { + background-color: #005a00; + color: white; + font-family: serif; + text-decoration: none; + padding-top: 2px; + padding-right: 4px; + padding-bottom: 2px; + padding-left: 4px; + font-weight: bold; +} + +#demonstrator_cccSelection{ + margin-bottom: auto; +} diff --git a/id/oa/src/main/webapp/demoapp.jsp b/id/oa/src/main/webapp/demoapp.jsp new file mode 100644 index 000000000..c6b005deb --- /dev/null +++ b/id/oa/src/main/webapp/demoapp.jsp @@ -0,0 +1,73 @@ + +<%@ page import = "at.gv.egovernment.moa.id.demoOA.utils.ApplicationBean" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> + + + + + + + Demo Applikation + + + + <% + ApplicationBean bean = (ApplicationBean) request.getAttribute("answers"); + %> + +
+ +
+

Anmeldedaten

+
+ + <% if (bean.isLogin()) {%> +
+
+

LogOut

+
+ +
+ + + + + +
Benutzerdaten:<%= bean.getGivenName()%>  + <%= bean.getFamilyName()%>  + <%= bean.getDateOfBirth()%>
+ + <%} else { %> + +
+ LogIn +
+

<%= bean.getErrorMessage()%>

+ <%} %> + + +
+ +
+ + +
+

SAML Assertion

+
+ +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/id/oa/src/main/webapp/form.jsp b/id/oa/src/main/webapp/form.jsp deleted file mode 100644 index d439fa84d..000000000 --- a/id/oa/src/main/webapp/form.jsp +++ /dev/null @@ -1,20 +0,0 @@ -<%@ 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/src/main/webapp/getBKUSelectTag.jsp b/id/oa/src/main/webapp/getBKUSelectTag.jsp deleted file mode 100644 index 028dbd348..000000000 --- a/id/oa/src/main/webapp/getBKUSelectTag.jsp +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/id/oa/src/main/webapp/index.jsp b/id/oa/src/main/webapp/index.jsp deleted file mode 100644 index 35e49d743..000000000 --- a/id/oa/src/main/webapp/index.jsp +++ /dev/null @@ -1,60 +0,0 @@ -<%@ page import="java.util.*,javax.servlet.http.*,sun.misc.BASE64Decoder" %> - - -Sample Online Application - - -

Sample Online Application

- -

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

- -<% String query=request.getQueryString(); %> -

QueryString: "<%=query%>" -

- -

Request parameters: - - <% - /* collect parameters from request */ - for (Enumeration params = request.getParameterNames(); params.hasMoreElements(); ) { - String name = (String) params.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/src/main/webapp/js/common.js b/id/oa/src/main/webapp/js/common.js new file mode 100644 index 000000000..59b7b4e0e --- /dev/null +++ b/id/oa/src/main/webapp/js/common.js @@ -0,0 +1,32 @@ +function gup(name) { + name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); + var regexS = "[\\?&]"+name+"=([^&#]*)"; + var regex = new RegExp( regexS ); + var results = regex.exec( window.location.href ); + if( results == null ) + return ""; + else + return results[1]; +} +function jumpToAnker() { + var jump = gup("jump"); + if (jump != "") { + location.hash="#"+jump; + } +} +function PVP2LoginIframe(url) { + var el = document.getElementById("demonstrator_leftcontent"); + + var iframe = document.createElement("iframe"); + iframe.setAttribute("src", url); + iframe.setAttribute("width", "240"); + iframe.setAttribute("height", "220"); + iframe.setAttribute("frameborder", "0"); + iframe.setAttribute("scrolling", "no"); + iframe.setAttribute("title", "Login"); + + var button = document.getElementById("submitbutton"); + button.parentNode.removeChild(button); + + el.appendChild(iframe, el); +} diff --git a/id/oa/src/main/webapp/stateful_login.jsp b/id/oa/src/main/webapp/stateful_login.jsp deleted file mode 100644 index eaede507f..000000000 --- a/id/oa/src/main/webapp/stateful_login.jsp +++ /dev/null @@ -1,29 +0,0 @@ -<%@ 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