diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2015-09-02 17:06:24 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2015-09-02 17:06:24 +0200 |
commit | aa1dda4e14e7aebd3ec0df5e50493d273a65d999 (patch) | |
tree | a92576ddbc803dc640e2bf3e94cef508159b1663 /id/server/idserverlib/src | |
parent | bf97a44c97eac39401200cc2e57f6aba08e2008b (diff) | |
download | moa-id-spss-aa1dda4e14e7aebd3ec0df5e50493d273a65d999.tar.gz moa-id-spss-aa1dda4e14e7aebd3ec0df5e50493d273a65d999.tar.bz2 moa-id-spss-aa1dda4e14e7aebd3ec0df5e50493d273a65d999.zip |
fix problem with private service applications and target friendlyname
Diffstat (limited to 'id/server/idserverlib/src')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java | 79 |
1 files changed, 42 insertions, 37 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java index ded261bfc..32ee2a126 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java @@ -125,42 +125,51 @@ public class StartAuthentificationParameterParser extends MOAIDAuthConstants{ // get target and target friendly name from config String targetConfig = oaParam.getTarget(); String targetFriendlyNameConfig = oaParam.getTargetFriendlyName(); - - if (StringUtils.isEmpty(targetConfig) - || (module.equals(SAML1Protocol.PATH) && - !StringUtils.isEmpty(target)) - ) { - //INFO: ONLY SAML1 legacy mode - // if SAML1 is used and target attribute is given in request - // use requested target - // check target parameter - if (!ParamValidatorUtils.isValidTarget(target)) { - Logger.error("Selected target is invalid. Using target: " + target); - throw new WrongParametersException("StartAuthentication", PARAM_TARGET, "auth.12"); - } - if (MiscUtil.isNotEmpty(targetConfig)) - targetFriendlyName = targetFriendlyNameConfig; - - else { - String sectorName = TargetToSectorNameMapper.getSectorNameViaTarget(target); - if (MiscUtil.isNotEmpty(sectorName)) - targetFriendlyName = sectorName; + + if (!oaParam.getBusinessService()) { + if (StringUtils.isEmpty(targetConfig) + || (module.equals(SAML1Protocol.PATH) && + !StringUtils.isEmpty(target)) + ) { + //INFO: ONLY SAML1 legacy mode + // if SAML1 is used and target attribute is given in request + // use requested target + // check target parameter + if (!ParamValidatorUtils.isValidTarget(target)) { + Logger.error("Selected target is invalid. Using target: " + target); + throw new WrongParametersException("StartAuthentication", PARAM_TARGET, "auth.12"); + } + if (MiscUtil.isNotEmpty(targetConfig)) + targetFriendlyName = targetFriendlyNameConfig; else { - //check target contains subSector - int delimiter = target.indexOf("-"); - if (delimiter > 0) { - targetFriendlyName = - TargetToSectorNameMapper.getSectorNameViaTarget(target.substring(0, delimiter)); - - } - } + String sectorName = TargetToSectorNameMapper.getSectorNameViaTarget(target); + if (MiscUtil.isNotEmpty(sectorName)) + targetFriendlyName = sectorName; + + else { + //check target contains subSector + int delimiter = target.indexOf("-"); + if (delimiter > 0) { + targetFriendlyName = + TargetToSectorNameMapper.getSectorNameViaTarget(target.substring(0, delimiter)); + + } + } + } + + } else { + // use target from config + target = targetConfig; + targetFriendlyName = targetFriendlyNameConfig; } - + moasession.setTarget(target); + moasession.setTargetFriendlyName(targetFriendlyName); + } else { - // use target from config - target = targetConfig; - targetFriendlyName = targetFriendlyNameConfig; + Logger.debug("Business: " + moasession.getBusinessService() + " stork: " + moasession.getStorkService()); + moasession.setDomainIdentifier(oaParam.getIdentityLinkDomainIdentifier()); + } @@ -204,13 +213,9 @@ public class StartAuthentificationParameterParser extends MOAIDAuthConstants{ } moasession.setPublicOAURLPrefix(oaParam.getPublicURLPrefix()); - - moasession.setTarget(target); moasession.setBusinessService(oaParam.getBusinessService()); + //moasession.setStorkService(oaParam.getStorkService()); - Logger.debug("Business: " + moasession.getBusinessService() + " stork: " + moasession.getStorkService()); - moasession.setTargetFriendlyName(targetFriendlyName); - moasession.setDomainIdentifier(oaParam.getIdentityLinkDomainIdentifier()); } //check OnlineApplicationURL |