aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-frontend-resources
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2017-11-21 12:14:09 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2017-11-21 12:14:09 +0100
commitb1940fc000b40808a7d173125d5552e9e0424024 (patch)
treeab96581fd3522525e8d30647de875d8f7834790b /id/server/moa-id-frontend-resources
parent27b687ed27fad429e6fbf1b3e69c579a8f2aae16 (diff)
parent1b5e11112af6bbe48bfb5c95c8b75ae90f3edb22 (diff)
downloadmoa-id-spss-b1940fc000b40808a7d173125d5552e9e0424024.tar.gz
moa-id-spss-b1940fc000b40808a7d173125d5552e9e0424024.tar.bz2
moa-id-spss-b1940fc000b40808a7d173125d5552e9e0424024.zip
Merge branch 'eIDAS_node_implementation' of https://gitlab.iaik.tugraz.at/egiz/moa-idspss into eIDAS_node_implementation
Diffstat (limited to 'id/server/moa-id-frontend-resources')
-rw-r--r--id/server/moa-id-frontend-resources/pom.xml72
-rw-r--r--id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/AbstractServiceProviderSpecificGUIFormBuilderConfiguration.java48
-rw-r--r--id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/DefaultGUIFormBuilderConfiguration.java11
-rw-r--r--id/server/moa-id-frontend-resources/src/main/resources/mainGUI/iframeLBKUdetect.html2
-rw-r--r--id/server/moa-id-frontend-resources/src/main/resources/mainGUI/index.html2
-rw-r--r--id/server/moa-id-frontend-resources/src/main/resources/mainGUI/template_thirdBKU.html37
-rw-r--r--id/server/moa-id-frontend-resources/src/main/resources/templates/iframeLBKUdetectSPSpecific.html12
-rw-r--r--id/server/moa-id-frontend-resources/src/main/resources/templates/loginFormFull.html10
8 files changed, 182 insertions, 12 deletions
diff --git a/id/server/moa-id-frontend-resources/pom.xml b/id/server/moa-id-frontend-resources/pom.xml
index 64ebc14b6..342cedac8 100644
--- a/id/server/moa-id-frontend-resources/pom.xml
+++ b/id/server/moa-id-frontend-resources/pom.xml
@@ -29,6 +29,78 @@
<repositoryPath>${basedir}/../../../../repository</repositoryPath>
</properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>groovy-maven-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ <![CDATA[
+ println("==== Creating version.txt ====");
+ File mainDir = new File("${basedir}/src/main/resources");
+ if(mainDir.exists() && !mainDir.isDirectory()) {
+ println("Main dir does not exist, wont create version.txt!");
+ return;
+ }
+ File confDir = new File("${basedir}/src/main/resources/mainGUI");
+ if(confDir.exists() && !confDir.isDirectory()) {
+ println("Conf dir is not a directory, wont create version.txt!");
+ return;
+ }
+ if(!confDir.exists()) {
+ confDir.mkdir();
+ }
+ File versionFile = new File("${basedir}/src/main/resources/mainGUI/version.txt");
+ if(versionFile.exists() && versionFile.isDirectory()) {
+ println("Version file exists and is directory! Wont overwrite");
+ return;
+ }
+ if(versionFile.exists() && !versionFile.isDirectory()) {
+ println("Version file already exists, overwriting!");
+ }
+ println("Creating Version File");
+ BufferedWriter writer = new BufferedWriter(new FileWriter(versionFile));
+
+ writer.write("groupId = ${project.groupId}");
+ writer.newLine();
+ writer.write("version = ${project.version}");
+ writer.newLine();
+ writer.write("timestamp = ${maven.build.timestamp}");
+
+ String buildTag = "";
+ String buildNumber = "";
+ String buildId = "";
+ try {
+ buildTag = "${BUILD_TAG}";
+ buildNumber = "${BUILD_NUMBER}";
+ buildId = "${BUILD_ID}";
+
+ writer.write("BUILD_TAG = " + buildTag + "\n");
+ writer.write("BUILD_NUMBER = " + buildNumber + "\n");
+ writer.write("BUILD_ID = " + buildId + "\n");
+
+ } catch (Exception e) {
+ println("============= Could not find BUILD_TAG probably this is not a Jenkins/Hudson build ===========");
+ }
+
+ writer.close();
+ ]]>
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<dependency>
<groupId>MOA.id.server</groupId>
diff --git a/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/AbstractServiceProviderSpecificGUIFormBuilderConfiguration.java b/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/AbstractServiceProviderSpecificGUIFormBuilderConfiguration.java
index 4bb4b0e27..15bc92a54 100644
--- a/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/AbstractServiceProviderSpecificGUIFormBuilderConfiguration.java
+++ b/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/AbstractServiceProviderSpecificGUIFormBuilderConfiguration.java
@@ -27,6 +27,8 @@ import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
+import org.apache.commons.lang.StringEscapeUtils;
+
import at.gv.egovernment.moa.id.auth.frontend.utils.FormBuildUtils;
import at.gv.egovernment.moa.id.commons.MOAIDAuthConstants;
import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
@@ -41,19 +43,28 @@ import at.gv.egovernment.moa.util.MiscUtil;
*/
public abstract class AbstractServiceProviderSpecificGUIFormBuilderConfiguration extends AbstractGUIFormBuilderConfiguration {
+ public static final String VIEW_TEMPLATE_MAINGUI_DIRECTORY = "mainGUI/";
+
public static final String VIEW_BKUSELECTION = "loginFormFull.html";
public static final String VIEW_SENDASSERTION = "sendAssertionFormFull.html";
public static final String VIEW_TEMPLATE_CSS = "css_template.css";
- public static final String VIEW_TEMPLATE_JS = "javascript_tempalte.js";
+ public static final String VIEW_TEMPLATE_JS = "javascript_tempalte.js";
+ public static final String VIEW_TEMPLATE_BKUDETECTION_SP_SPECIFIC = "iframeLBKUdetectSPSpecific.html";
+ public static final String VIEW_TEMPLATE_BKUDETECTION_GENERIC = "iframeLBKUdetect.html";
public static final String PARAM_BKU_ONLINE = "bkuOnline";
public static final String PARAM_BKU_HANDY = "bkuHandy";
- public static final String PARAM_BKU_LOCAL = "bkuLocal";
+ public static final String PARAM_BKU_LOCAL = "bkuLocal";
+
+ public static final String PARAM_BKU_URL_HANDY = "bkuURLHandy";
+ public static final String PARAM_BKU_URL_LOCAL = "bkuURLLocal";
+ public static final String PARAM_BKU_URL_THIRD = "bkuURLThird";
public static final String PARAM_OANAME = "OAName";
public static final String PARAM_COUNTRYLIST = "countryList";
protected IRequest pendingReq = null;
+ protected String templateClasspahtDir = null;
/**
* @param authURL PublicURLPrefix of the IDP but never null
@@ -86,18 +97,30 @@ public abstract class AbstractServiceProviderSpecificGUIFormBuilderConfiguration
@Override
public Map<String, Object> getSpecificViewParameters() {
Map<String, Object> params = new HashMap<String, Object>();
- params.put(PARAM_BKU_ONLINE, IOAAuthParameters.ONLINEBKU);
+ params.put(PARAM_BKU_ONLINE, IOAAuthParameters.THIRDBKU);
params.put(PARAM_BKU_HANDY, IOAAuthParameters.HANDYBKU);
params.put(PARAM_BKU_LOCAL, IOAAuthParameters.LOCALBKU);
if (pendingReq != null) {
- params.put(PARAM_PENDINGREQUESTID, pendingReq.getRequestID());
+ params.put(PARAM_PENDINGREQUESTID, StringEscapeUtils.escapeHtml(pendingReq.getRequestID()));
//add service-provider specific GUI parameters
IOAAuthParameters oaParam = pendingReq.getOnlineApplicationConfiguration();
if (oaParam != null) {
params.put(PARAM_OANAME, oaParam.getFriendlyName());
-
+
+ //set BKU URLs
+ if (MiscUtil.isNotEmpty(oaParam.getBKUURL(IOAAuthParameters.LOCALBKU)))
+ params.put(PARAM_BKU_URL_LOCAL, oaParam.getBKUURL(IOAAuthParameters.LOCALBKU));
+ else
+ params.put(PARAM_BKU_URL_LOCAL, MOAIDAuthConstants.DEFAULT_BKU_HTTPS);
+
+ if (MiscUtil.isNotEmpty(oaParam.getBKUURL(IOAAuthParameters.HANDYBKU)))
+ params.put(PARAM_BKU_URL_HANDY, oaParam.getBKUURL(IOAAuthParameters.HANDYBKU));
+ if (MiscUtil.isNotEmpty(oaParam.getBKUURL(IOAAuthParameters.THIRDBKU)))
+ params.put(PARAM_BKU_URL_THIRD, oaParam.getBKUURL(IOAAuthParameters.THIRDBKU));
+
+ //set eIDAS login information if requird
if (oaParam.isShowStorkLogin())
addCountrySelection(params, oaParam);
else
@@ -151,7 +174,7 @@ public abstract class AbstractServiceProviderSpecificGUIFormBuilderConfiguration
*/
@Override
public String getClasspathTemplateDir() {
- return null;
+ return templateClasspahtDir;
}
/* (non-Javadoc)
@@ -184,4 +207,17 @@ public abstract class AbstractServiceProviderSpecificGUIFormBuilderConfiguration
return null;
}
+ /**
+ * Set a specific classPath directory for this template configuration.
+ * <br> If the directory is null then the default directory /templates is used.
+ *
+ * @param templateClasspahtDir the templateClasspahtDir to set
+ */
+ public void setTemplateClasspahtDir(String templateClasspahtDir) {
+ this.templateClasspahtDir = templateClasspahtDir;
+ }
+
+
+
+
}
diff --git a/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/DefaultGUIFormBuilderConfiguration.java b/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/DefaultGUIFormBuilderConfiguration.java
index 2c2792b84..0c07ad3fb 100644
--- a/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/DefaultGUIFormBuilderConfiguration.java
+++ b/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/DefaultGUIFormBuilderConfiguration.java
@@ -26,6 +26,8 @@ import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
+import org.apache.commons.lang.StringEscapeUtils;
+
import at.gv.egovernment.moa.id.commons.api.IRequest;
/**
@@ -68,6 +70,13 @@ public class DefaultGUIFormBuilderConfiguration extends AbstractGUIFormBuilderCo
}
+ /**
+ * Add a key/value pair into Velocity context.<br>
+ * <b>IMPORTANT:</b> external HTML escapetion is required, because it is NOT done internally
+ *
+ * @param key velocity context key
+ * @param value of this key
+ */
public void putCustomParameter(String key, Object value) {
if (customParameters == null)
customParameters = new HashMap<String, Object>();
@@ -82,7 +91,7 @@ public class DefaultGUIFormBuilderConfiguration extends AbstractGUIFormBuilderCo
public Map<String, Object> getSpecificViewParameters() {
Map<String, Object> params = new HashMap<String, Object>();
if (pendingReq != null) {
- params.put(PARAM_PENDINGREQUESTID, pendingReq.getRequestID());
+ params.put(PARAM_PENDINGREQUESTID, StringEscapeUtils.escapeHtml(pendingReq.getRequestID()));
}
if (customParameters != null)
diff --git a/id/server/moa-id-frontend-resources/src/main/resources/mainGUI/iframeLBKUdetect.html b/id/server/moa-id-frontend-resources/src/main/resources/mainGUI/iframeLBKUdetect.html
index 54dc9d910..261e19a33 100644
--- a/id/server/moa-id-frontend-resources/src/main/resources/mainGUI/iframeLBKUdetect.html
+++ b/id/server/moa-id-frontend-resources/src/main/resources/mainGUI/iframeLBKUdetect.html
@@ -24,7 +24,7 @@
document.write('</form>');
try {
document.bkudetectform.submit();
- } catch(e) {}
+ } catch(e) {console.log(e)}
}
//-->
</script>
diff --git a/id/server/moa-id-frontend-resources/src/main/resources/mainGUI/index.html b/id/server/moa-id-frontend-resources/src/main/resources/mainGUI/index.html
index 5f7e92321..7fc2b0298 100644
--- a/id/server/moa-id-frontend-resources/src/main/resources/mainGUI/index.html
+++ b/id/server/moa-id-frontend-resources/src/main/resources/mainGUI/index.html
@@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf8" >
- <title>MOA-ID 3.2.x</title>
+ <title>MOA-ID 3.3.x</title>
<link rel="stylesheet" href="./common/main.css" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400' rel='stylesheet' type='text/css'>
diff --git a/id/server/moa-id-frontend-resources/src/main/resources/mainGUI/template_thirdBKU.html b/id/server/moa-id-frontend-resources/src/main/resources/mainGUI/template_thirdBKU.html
new file mode 100644
index 000000000..a9932d49d
--- /dev/null
+++ b/id/server/moa-id-frontend-resources/src/main/resources/mainGUI/template_thirdBKU.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="de">
+ <head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <script language="javascript" type="text/javascript">
+ function onAnmeldeSubmit() {
+ document.CustomizedForm.submit();
+ document.CustomizedForm.Senden.disabled=true;
+ }
+ </script>
+ </head>
+ <body onLoad="onAnmeldeSubmit()">
+ <form name="CustomizedForm" action="<BKU>" method="post" enctype="multipart/form-data">
+ Falls Sie nicht automatisch weitergeleitet werden klicken Sie bitte hier:
+ <input class="button" type="hidden" value="Starte Anmeldung" name="Senden">
+ <input type="hidden" name="XMLRequest" value="<XMLRequest>">
+ <input type="hidden" name="DataURL" value="<DataURL>">
+ <input type="hidden" name="PushInfobox" value="<PushInfobox>">
+
+ <!-- Angabe der Parameter fuer die Online-BKU -->
+ <input type="hidden" name="appletWidth" value="<APPLETWIDTH>">
+ <input type="hidden" name="appletHeight" value="<APPLETHEIGHT>">
+
+ <!-- [OPTIONAL] Aendern Sie hier die Hintergrundfarbe der Online-BKU -->
+ <input type="hidden" name="appletBackgroundColor" value="<COLOR>">
+ <input type="hidden" name="redirectTarget" value="<REDIRECTTARGET>">
+ </form>
+
+ <form name="CustomizedInfoForm" action="<BKU>" method="post">
+ <input type="hidden" name="XMLRequest" value="<CertInfoXMLRequest>">
+ <input type="hidden" name="DataURL" value="<CertInfoDataURL>">
+ </form>
+ <form name="DummyForm" action="<BKU>" method="post">
+ </form>
+ </body>
+</html>
diff --git a/id/server/moa-id-frontend-resources/src/main/resources/templates/iframeLBKUdetectSPSpecific.html b/id/server/moa-id-frontend-resources/src/main/resources/templates/iframeLBKUdetectSPSpecific.html
new file mode 100644
index 000000000..79a217946
--- /dev/null
+++ b/id/server/moa-id-frontend-resources/src/main/resources/templates/iframeLBKUdetectSPSpecific.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="de">
+<head>
+<title>BKU-Erkennung</title>
+</head>
+<body style="background-color:transparent" onload="parent.setBKUAvailable(false);document.forms[0].submit();">
+ <form name="bkudetectform" method="POST" target="bkudetect" action="$bkuURLLocal" enctype="application/x-www-form-urlencoded">
+ <input type="hidden" name="XMLRequest" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;NullOperationRequest xmlns=&quot;http://www.buergerkarte.at/namespaces/securitylayer/1.2#&quot;/&gt;" />
+ <input type="hidden" name="RedirectURL" value="$contextPath/iframeLBKUdetected.html"/>
+ </form>
+</body>
+</html>
diff --git a/id/server/moa-id-frontend-resources/src/main/resources/templates/loginFormFull.html b/id/server/moa-id-frontend-resources/src/main/resources/templates/loginFormFull.html
index 53c4f0d5d..c4da51dc1 100644
--- a/id/server/moa-id-frontend-resources/src/main/resources/templates/loginFormFull.html
+++ b/id/server/moa-id-frontend-resources/src/main/resources/templates/loginFormFull.html
@@ -50,8 +50,11 @@
<input type="hidden" name="ccc" id="ccc" />
<input type="hidden" name="pendingid" value="$pendingReqID" />
<input type="submit" value=" Karte " tabindex="4" role="button" onclick="setMandateSelection();">
- </form>
- <iframe name="bkudetect" width="0" height="0" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" src="$contextPath/iframeLBKUdetect.html"></iframe>
+ </form>
+ <iframe name="bkudetect" width="0" height="0" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" src="$contextPath/feature/bkuDetection?pendingid=$pendingReqID"></iframe>
+
+ <!-- BKU detection with static template-->
+ <!--iframe name="bkudetect" width="0" height="0" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" src="$contextPath/iframeLBKUdetect.html"></iframe-->
</div>
<div id="bkuhandy">
@@ -59,6 +62,7 @@
<input name="bkuButtonHandy" type="button" onClick="bkuHandyClicked();" tabindex="3" role="button" value="HANDY" />
</div>
</div>
+
<!--div id="localBKU">
<form method="get" id="moaidform" action="$contextPath$submitEndpoint"
class="verticalcenter" target="_parent">
@@ -70,7 +74,7 @@
<input type="submit" value=" Lokale Bürgerkartenumgebung " tabindex="4"
role="button" onclick="setMandateSelection();">
</form>
- <iframe name="bkudetect" width="0" height="0" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" src="$contextPath/iframeLBKUdetect.html"><\/iframe>
+ <iframe name="bkudetect" width="0" height="0" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" src="$contextPath/feature/bkuDetection"><\/iframe>
</div-->
<!-- Single Sign-On Session transfer functionality -->