aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-frontend-resources/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/moa-id-frontend-resources/src/main/java')
-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
2 files changed, 52 insertions, 7 deletions
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)