diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2017-10-18 15:09:25 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2017-10-18 15:09:25 +0200 |
commit | 372717f41f43bb6687fd708aeff153165a7005a9 (patch) | |
tree | c9026890d4dc2145344646bc47da6d936345ff65 /id | |
parent | 4c24b9ed9ec7fe27e490f7872d3c5f6da42506ca (diff) | |
download | moa-id-spss-372717f41f43bb6687fd708aeff153165a7005a9.tar.gz moa-id-spss-372717f41f43bb6687fd708aeff153165a7005a9.tar.bz2 moa-id-spss-372717f41f43bb6687fd708aeff153165a7005a9.zip |
some small refactoring in RedirectServlet
Diffstat (limited to 'id')
3 files changed, 40 insertions, 4 deletions
diff --git a/id/server/data/deploy/conf/moa-id/htmlTemplates/redirectForm.html b/id/server/data/deploy/conf/moa-id/htmlTemplates/redirectForm.html index ac3242c89..7b064e22a 100644 --- a/id/server/data/deploy/conf/moa-id/htmlTemplates/redirectForm.html +++ b/id/server/data/deploy/conf/moa-id/htmlTemplates/redirectForm.html @@ -7,7 +7,27 @@ <body onload="document.getElementById('link').click();"> - <a href="$URL" target="$TARGET" id="link">CLICK to perform a - redirect back to Online Application</a> + <div id="page"> + + <div id="page1" class="case selected-case" role="main"> + +<!-- <h2 class="OA_header">Anmeldung an: #OAName#</h2> --> + + <div id="main"> + <div id="leftcontent" class="hell"> + <div id="bku_header" class="dunkel"> + <h2 id="tabheader" class="dunkel" role="heading"> + >You get redirected ... + </h2> + </div> + + <div id="selectArea" class="hell" role="application"> + <a href="$URL" target="$TARGET" id="link">Click here if it does not resume</a> + + </div> + </div> + </div> + </div> + </div> </body> </html> diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java index 1848fa6f7..be511d888 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java @@ -49,6 +49,8 @@ import at.gv.egovernment.moa.util.URLEncoder; @Controller public class RedirectServlet { + public static final String SERVICE_ENDPOINT = "/RedirectServlet"; + public static final String REDIRCT_PARAM_URL = "redirecturl"; private static final String DEFAULT_REDIRECTTARGET = "_parent"; @@ -74,6 +76,8 @@ public class RedirectServlet { //validate URL new java.net.URL(url); + //url = URLDecoder.decode(url, "UTF-8"); + oa = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(url); String authURL = HTTPUtils.extractAuthURLFromRequest(req); @@ -128,12 +132,24 @@ public class RedirectServlet { resp.addHeader("Location", url); } else { - Logger.debug("Redirect to " + url); + Logger.debug("Redirect to " + url); + + try { + String test = oa.getConfigurationValue(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_APPLETREDIRECTTARGET); + if (MiscUtil.isNotEmpty(test)) + redirectTarget = test; + + } catch (Exception e) { + Logger.debug("Use default redirectTarget."); + } + DefaultGUIFormBuilderConfiguration config = new DefaultGUIFormBuilderConfiguration( authURL, DefaultGUIFormBuilderConfiguration.VIEW_REDIRECT, null); config.putCustomParameter(URL, StringEscapeUtils.escapeHtml(url)); + config.putCustomParameter(TARGET, redirectTarget); + guiBuilder.build(resp, config, "RedirectForm.html"); } diff --git a/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java b/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java index 9981e8156..99d5d9063 100644 --- a/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java +++ b/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java @@ -88,7 +88,7 @@ public class GetArtifactAction implements IAction { String oaTargetArea = req.getGenericData(SAML1Protocol.REQ_DATA_TARGET, String.class); if (authData.isSsoSession()) { - String url = req.getAuthURL() + "/RedirectServlet"; + String url = req.getAuthURL() + RedirectServlet.SERVICE_ENDPOINT; url = addURLParameter(url, RedirectServlet.REDIRCT_PARAM_URL, URLEncoder.encode(oaURL, "UTF-8")); if (MiscUtil.isNotEmpty(oaTargetArea)) url = addURLParameter(url, MOAIDAuthConstants.PARAM_TARGET, |