From 890b5011fce5157d73050517aa0b22dd906fb394 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 7 Oct 2016 07:42:14 +0200 Subject: add additional redirect in elga mandate-service selection-process to get out from BKU communication switch version of elga-mandate-module to 1.1 --- .../egovernment/moa/id/auth/builder/DataURLBuilder.java | 3 +++ .../moa/id/auth/modules/AbstractAuthServletTask.java | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'id/server/idserverlib/src/main/java/at') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java index 8334780ba..c78361eda 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java @@ -79,6 +79,9 @@ public class DataURLBuilder { if (!authBaseURL.endsWith("/")) authBaseURL += "/"; + if (authServletName.startsWith("/")) + authServletName = authServletName.substring(1); + dataURL = authBaseURL + authServletName; dataURL = addParameter(dataURL, MOAIDAuthConstants.PARAM_TARGET_PENDINGREQUESTID, sessionID); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/AbstractAuthServletTask.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/AbstractAuthServletTask.java index 84ca9fa05..1b78ff677 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/AbstractAuthServletTask.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/AbstractAuthServletTask.java @@ -109,8 +109,20 @@ public abstract class AbstractAuthServletTask extends MoaIdTask { * @param httpResp */ protected void performRedirectToProtocolFinialization(IRequest pendingReq, HttpServletResponse httpResp) { + performRedirectToItself(pendingReq, httpResp, AbstractAuthProtocolModulController.FINALIZEPROTOCOL_ENDPOINT); + + } + + /** + * Redirect the authentication process to MOA-ID-Auth itself + * + * @param pendingReq Actually processed protocol specific authentication request + * @param httpResp + * @param moaIDEndPoint Servlet EndPoint that should receive the redirect + */ + protected void performRedirectToItself(IRequest pendingReq, HttpServletResponse httpResp, String moaIDEndPoint) { String redirectURL = new DataURLBuilder().buildDataURL(pendingReq.getAuthURL(), - AbstractAuthProtocolModulController.FINALIZEPROTOCOL_ENDPOINT, pendingReq.getRequestID()); + moaIDEndPoint, pendingReq.getRequestID()); httpResp.setContentType("text/html"); httpResp.setStatus(302); @@ -119,6 +131,7 @@ public abstract class AbstractAuthServletTask extends MoaIdTask { } + /** * Parses the request input stream for parameters, assuming parameters are * encoded UTF-8 (no standard exists how browsers should encode them). -- cgit v1.2.3