diff options
author | Thomas <> | 2022-08-05 13:10:37 +0200 |
---|---|---|
committer | Thomas <> | 2022-08-05 13:10:37 +0200 |
commit | 669e1d6571b4bddcf5955597bcfe90e1523a6714 (patch) | |
tree | a562cfce16a1736fbf11d8d0ba69a189bdcb79e9 /modules/eidas_proxy-sevice/src/main | |
parent | f381c610acdecb06a8561389a4d1598738559948 (diff) | |
download | National_eIDAS_Gateway-669e1d6571b4bddcf5955597bcfe90e1523a6714.tar.gz National_eIDAS_Gateway-669e1d6571b4bddcf5955597bcfe90e1523a6714.tar.bz2 National_eIDAS_Gateway-669e1d6571b4bddcf5955597bcfe90e1523a6714.zip |
feat(proxy-service): add work-around to support mandates for legal- and natural-persons in parallel
Diffstat (limited to 'modules/eidas_proxy-sevice/src/main')
-rw-r--r-- | modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/EidasProxyServiceController.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/EidasProxyServiceController.java b/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/EidasProxyServiceController.java index 26cc51ee..9a0331bd 100644 --- a/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/EidasProxyServiceController.java +++ b/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/EidasProxyServiceController.java @@ -14,6 +14,7 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.opensaml.saml.saml2.core.NameIDType; @@ -429,8 +430,18 @@ public class EidasProxyServiceController extends AbstractController implements I log.trace("eIDAS Proxy-Service allows mandates for Connector: {}. Selecting profiles ... ", spConfig.getUniqueIdentifier()); - //check if legal person is requested - if (EidasProxyServiceUtils.isLegalPersonRequested(eidasRequest)) { + if (EidasProxyServiceUtils.isLegalPersonRequested(eidasRequest) + && EidasProxyServiceUtils.isNaturalPersonRequested(eidasRequest)) { + log.debug("Find requested attributes for legal and natural persons. Injecting mandate-profiles for both ... "); + spConfig.setMandateProfiles(ListUtils.union( + KeyValueUtils.getListOfCsvValues( + spConfig.getConfigurationValue(MsProxyServiceConstants.CONIG_PROPS_CONNECTOR_MANDATES_PROFILE_NATURAL)), + KeyValueUtils.getListOfCsvValues( + spConfig.getConfigurationValue(MsProxyServiceConstants.CONIG_PROPS_CONNECTOR_MANDATES_PROFILE_LEGAL)))); + spConfig.setMandateMode(SpMandateModes.BOTH); + + } else if (EidasProxyServiceUtils.isLegalPersonRequested(eidasRequest)) { + //check if legal person is requested spConfig.setMandateProfiles(KeyValueUtils.getListOfCsvValues( spConfig.getConfigurationValue(MsProxyServiceConstants.CONIG_PROPS_CONNECTOR_MANDATES_PROFILE_LEGAL))); spConfig.setMandateMode(SpMandateModes.LEGAL_FORCE); |