aboutsummaryrefslogtreecommitdiff
path: root/id/oa/src/main/webapp
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-01-27 16:27:02 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-01-27 16:27:02 +0100
commitcea2f395ec773b386ec628d60120752cf320f6b6 (patch)
tree2145dbbe25f0b4f99c89e60834176ea8fa1d435c /id/oa/src/main/webapp
parent653fd79254188db598c0b980640fab912c9e39f7 (diff)
downloadmoa-id-spss-cea2f395ec773b386ec628d60120752cf320f6b6.tar.gz
moa-id-spss-cea2f395ec773b386ec628d60120752cf320f6b6.tar.bz2
moa-id-spss-cea2f395ec773b386ec628d60120752cf320f6b6.zip
add PVP2 Demo Application
change SZRGWClient to JAXWs
Diffstat (limited to 'id/oa/src/main/webapp')
-rw-r--r--id/oa/src/main/webapp/WEB-INF/web.xml36
-rw-r--r--id/oa/src/main/webapp/auth.jsp48
-rw-r--r--id/oa/src/main/webapp/chooseBKU.jsp19
-rw-r--r--id/oa/src/main/webapp/css/index.css205
-rw-r--r--id/oa/src/main/webapp/demoapp.jsp73
-rw-r--r--id/oa/src/main/webapp/form.jsp20
-rw-r--r--id/oa/src/main/webapp/getBKUSelectTag.jsp6
-rw-r--r--id/oa/src/main/webapp/index.jsp60
-rw-r--r--id/oa/src/main/webapp/js/common.js32
-rw-r--r--id/oa/src/main/webapp/stateful_login.jsp29
10 files changed, 345 insertions, 183 deletions
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 @@
<web-app>
<display-name>Sample OA</display-name>
- <description>MOA Sample OA</description>
+ <description>MOA PVP2.1 Sample OA</description>
+
+ <servlet>
+ <servlet-name>pvp2login</servlet-name>
+ <display-name>pvp2login</display-name>
+ <servlet-class>at.gv.egovernment.moa.id.demoOA.servlet.pvp2.Authenticate</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>pvp2login</servlet-name>
+ <url-pattern>/servlet/pvp2login</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>pvp2metadata</servlet-name>
+ <display-name>Metadata</display-name>
+ <servlet-class>at.gv.egovernment.moa.id.demoOA.servlet.pvp2.BuildMetadata</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>pvp2metadata</servlet-name>
+ <url-pattern>/servlet/metadata</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>pvp2demooa</servlet-name>
+ <display-name>Secure area</display-name>
+ <servlet-class>at.gv.egovernment.moa.id.demoOA.servlet.pvp2.DemoApplication</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>pvp2demooa</servlet-name>
+ <url-pattern>/demoapplication</url-pattern>
+ </servlet-mapping>
+
</web-app>
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 @@
-<html>
-<head>
-<title>MOA ID Auth Sample Login</title>
-</head>
-<body>
-<% /** 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";
-%>
-<a href="<%=urlStartAuth%>">Log in to sample application</a>
-<br>
-<a href="<%=urlStartAuthCustom%>">Log in to sample application using custom form</a>
-<br>
-<a href="<%=urlSelectBKU%>">Choose BKU (HTMLComplete or HTMLSelect) and log in</a>
-<br>
-<a href="<%=urlSelectBKUCustom%>">Choose BKU (HTMLSelect) using custom form and log in</a>
-<br>
-<a href="<%=authUrlPath+"StartAuthentication"%>">Wrong parameters example</a>
-</body>
-</html> \ 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 @@
-<html>
-<head>
-<title>BKU Auswahl</title>
-</head>
-<body>
-<h1>BKU Auswahl</h1>
-<p>
-<form method="post" action="<%=request.getParameter("returnURI")%>">
-<select name="bkuURI">
- <option value="http://localhost:3495/http-security-layer-request" selected>Lokale B&uuml;rgerkarte</option>
- <option value="https://provider1.at:3496/http-security-layer-request">Provider eins</option>
- <option value="https://provider2.at:3496/http-security-layer-request">Provider zwei</option>
- <option value="https://10.16.126.28:3496/http-security-layer-request">B&uuml;rgerkarte Arbeitsplatz Paul Ivancsics</option>
-</select>
-<input type="submit" value="Ausw&auml;hlen"/>
-</form>
-</p>
-</body>
-</html> \ 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 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<%@ 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"%>
+
+<html>
+<head>
+ <meta http-equiv="Content-Type\" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <link rel="stylesheet" type="text/css" href="css/index.css">
+ <title>Demo Applikation</title>
+</head>
+<body>
+
+ <%
+ ApplicationBean bean = (ApplicationBean) request.getAttribute("answers");
+ %>
+
+ <div id="demonstrator_main" class="demonstrator_main_success">
+
+ <div id="demonstrator_centercontent">
+ <h2 id="demonstrator_contentheader" class="demonstrator_dunkel">Anmeldedaten</h2>
+ <div id="demonstrator_content" class="demonstrator_hell">
+
+ <% if (bean.isLogin()) {%>
+ <div id="demonstrator_centercontent">
+ <div class="demonstrator_logoutButton">
+ <p class="logoutbuttons"><a href="index.jsp" class="logoutbuttons">LogOut</a></p>
+ </div>
+
+ <div id="demonstrator_loginInformation">
+ <table>
+ <tr>
+ <td align="right">Benutzerdaten:</td>
+ <td><%= bean.getGivenName()%>&nbsp;
+ <%= bean.getFamilyName()%>&nbsp;
+ <%= bean.getDateOfBirth()%></td>
+ </tr>
+ </table>
+
+ <%} else { %>
+
+ <div class="demonstrator_logoutButton">
+ <a href="index.jsp">LogIn</a>
+ </div>
+ <p><%= bean.getErrorMessage()%></p>
+ <%} %>
+
+
+ <div id="demonstrator_showSAMLButton" class="demonstrator_button"\>
+ <input type="button"
+ onclick="document.getElementById('demonstrator_SAML-assertion').style.display='block';document.getElementById('demonstrator_showSAMLButton').hidden='true';document.getElementById('demonstrator_hideSAMLButton').hidden='';"
+ value='Assertion anzeigen'/>
+ </div>
+ <div id="demonstrator_hideSAMLButton" class="demonstrator_button" hidden>
+ <input type="button"
+ onclick="document.getElementById('demonstrator_SAML-assertion').style.display='none';document.getElementById('demonstrator_showSAMLButton').hidden='';document.getElementById('demonstrator_hideSAMLButton').hidden='true';"
+ value='Assertion ausblenden'/>
+ </div>
+
+ <div id="demonstrator_SAML-assertion">
+ <p>SAML Assertion</p>
+ <form>
+ <textarea id="demonstrator_samlArea" rows="10"><%= bean.getAssertion()%></textarea>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+</body>
+</html> \ 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.*" %>
-<html>
-<head>
-<title>Sample Online Application</title>
-</head>
-<body>
-<h1>Sample Form</h1>
-<p>
-<form action="form.jsp">
-<% String param1 = request.getParameter("param1");
- if (param1 == null) param1 = ""; %>
-Input some text:
-<input type="text" name="param1" size="10"/>
-<br>Previous text input: <%=param1%><br>
-<input type="submit" value="Send"/>
-</form>
-</p>
-<p><a href="index.jsp">Back</a></p>
-</body>
-</html> \ 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 @@
-<select name="bkuURI">
- <option value="http://localhost:3495/http-security-layer-request" selected>Lokale B&uuml;rgerkarte</option>
- <option value="https://provider1.at:3496/http-security-layer-request">Provider eins</option>
- <option value="https://provider2.at:3496/http-security-layer-request">Provider zwei</option>
- <option value="https://10.16.126.28:3496/http-security-layer-request">B&uuml;rgerkarte Arbeitsplatz Paul Ivancsics</option>
-</select>
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" %>
-<html>
-<head>
-<title>Sample Online Application</title>
-</head>
-<body>
-<h1>Sample Online Application</h1>
-
-<p>Request headers:
-<table border="1">
- <%
- /* collect parameters from request */
- for (Enumeration headers = request.getHeaderNames(); headers.hasMoreElements(); ) {
- String key = (String) headers.nextElement();
- String value = request.getHeader(key); %>
- <tr><td><%=key%></td><td><%=value%></td></tr>
- <% } %>
-</table>
-</p>
-
-<% String query=request.getQueryString(); %>
-<p>QueryString: "<%=query%>"
-</p>
-
-<p>Request parameters:
-<table border="1">
- <%
- /* collect parameters from request */
- for (Enumeration params = request.getParameterNames(); params.hasMoreElements(); ) {
- String name = (String) params.nextElement();
- String value = request.getParameter(name); %>
- <tr><td><%=name%></td><td><%=value%></td></tr>
- <% } %>
-</table>
-</p>
-
-<p>Cookies:
-<table border="1">
- <%
- /* collect attributes from request */
- Cookie[] cookies = request.getCookies();
- if (cookies != null) {
- for (int i = 0; i < cookies.length; i++) {
- Cookie cookie = cookies[i]; %>
- <tr><td><%=cookie.getName()%></td><td><%=cookie.getValue()%></td></tr>
- <% }
- } %>
-</table>
-</p>
-
-<% String authHeader = request.getHeader("Authorization");
- if (authHeader != null) {
- authHeader = authHeader.substring(authHeader.indexOf(" ")+1);
- String decAuthHeader = new String(new BASE64Decoder().decodeBuffer(authHeader));
-%>
-<p>Basic authentication credentials: <%=decAuthHeader%></p>
-<% } %>
-<p><a href="form.jsp">Form sample</a></p>
-</body>
-</html> \ 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 */
-%>