diff options
author | peter.danner <peter.danner@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2006-02-28 14:52:25 +0000 |
---|---|---|
committer | peter.danner <peter.danner@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2006-02-28 14:52:25 +0000 |
commit | 28fe5caeb64547e844cdb66c828d99576d74b9c4 (patch) | |
tree | 01df5c4952575fda26096680b8c3e01a49ffbfb4 | |
parent | 07067d3ac0477737c8e1b40231e9cadd1516a7be (diff) | |
download | moa-id-spss-28fe5caeb64547e844cdb66c828d99576d74b9c4.tar.gz moa-id-spss-28fe5caeb64547e844cdb66c828d99576d74b9c4.tar.bz2 moa-id-spss-28fe5caeb64547e844cdb66c828d99576d74b9c4.zip |
enhancements for generic extensions
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@643 d688527b-c9ab-4aba-bd8d-4036d912da1d
-rw-r--r-- | id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java | 41 | ||||
-rw-r--r-- | id.server/src/test/abnahme/P/Test100LoginParameterResolver.java | 2 |
2 files changed, 37 insertions, 6 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java b/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java index 53d0f701c..ff0f3a171 100644 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java +++ b/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java @@ -156,7 +156,7 @@ public class ProxyServlet extends HttpServlet { String urlRequested = req.getRequestURL().toString(); OAConfiguration oaConf = null; String loginType = ""; - String binding = "full"; + String binding = ""; if (session.getAttribute(ATT_BROWSERREQU)==null) { @@ -192,10 +192,38 @@ public class ProxyServlet extends HttpServlet { String clientIPAddress = req.getRemoteAddr(); boolean businessService = oaParam.getBusinessService(); try { - if (oaConf.getAuthType().equals(OAConfiguration.PARAM_AUTH)) - loginParameters = lpr.getAuthenticationParameters(oaConf, authData, clientIPAddress, businessService); - else + if (oaConf.getAuthType().equals(OAConfiguration.PARAM_AUTH)) { + loginParameters = lpr.getAuthenticationParameters(oaConf, authData, clientIPAddress, businessService, publicURLPrefix); + } else { loginHeaders = lpr.getAuthenticationHeaders(oaConf, authData, clientIPAddress, businessService, publicURLPrefix); + for (Iterator iter = loginHeaders.keySet().iterator(); iter.hasNext();) { + //extract user-defined bindingValue + String headerKey = (String) iter.next(); + String headerKeyValue = (String) loginHeaders.get(headerKey); + if (headerKey.equalsIgnoreCase("binding")) { + binding = (String) loginHeaders.get(headerKey); + } + for (int i = 1; i <= 3; i++) { + if (headerKey.equalsIgnoreCase("param" + i)) { + int sep = headerKeyValue.indexOf("="); + if (sep>-1) { + if (sep>0) { + String value = ""; + if (headerKeyValue.length()>sep+1) value = headerKeyValue.substring(sep+1); + if (loginParameters == null) loginParameters = new HashMap(); + loginParameters.put(headerKeyValue.substring(0,sep) , value); + } + } else { + loginParameters.put(headerKey, ""); + } + } + } + } + loginHeaders.remove("binding"); + loginHeaders.remove("param1"); + loginHeaders.remove("param2"); + loginHeaders.remove("param3"); + } } catch (LoginParameterResolverException ex) { throw new ProxyException("proxy.13", new Object[] { publicURLPrefix }); } catch (NotAllowedException e) { @@ -216,7 +244,10 @@ public class ProxyServlet extends HttpServlet { // for stateless online application, store data in HttpSession loginType = oaConf.getLoginType(); - binding = oaConf.getBinding(); + if ("".equalsIgnoreCase(binding)) { + binding = oaConf.getBinding(); + if ("".equalsIgnoreCase(binding)) binding = "full"; + } Logger.debug("Login type: " + loginType); if (loginType.equals(OAConfiguration.LOGINTYPE_STATELESS)) { int sessionTimeOut = oaParam.getSessionTimeOut(); diff --git a/id.server/src/test/abnahme/P/Test100LoginParameterResolver.java b/id.server/src/test/abnahme/P/Test100LoginParameterResolver.java index 3f84603b4..21958a367 100644 --- a/id.server/src/test/abnahme/P/Test100LoginParameterResolver.java +++ b/id.server/src/test/abnahme/P/Test100LoginParameterResolver.java @@ -87,7 +87,7 @@ public class Test100LoginParameterResolver extends AbnahmeTestCase { authData.setBPK(VPK); // resolve login parameters - Map loginParameters = lpr.getAuthenticationParameters(oaConf, authData, CLIENT_IP_ADDRESS, false); + Map loginParameters = lpr.getAuthenticationParameters(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); // validate login headers assertEquals(2, loginParameters.keySet().size()); |