diff options
Diffstat (limited to 'connector')
2 files changed, 16 insertions, 13 deletions
diff --git a/connector/src/main/java/at/asitplus/eidas/specific/connector/builder/AuthenticationDataBuilder.java b/connector/src/main/java/at/asitplus/eidas/specific/connector/builder/AuthenticationDataBuilder.java index 629d015e..05704de9 100644 --- a/connector/src/main/java/at/asitplus/eidas/specific/connector/builder/AuthenticationDataBuilder.java +++ b/connector/src/main/java/at/asitplus/eidas/specific/connector/builder/AuthenticationDataBuilder.java @@ -46,7 +46,6 @@ import at.gv.egiz.eaaf.core.exceptions.EaafAuthenticationException; import at.gv.egiz.eaaf.core.exceptions.EaafBuilderException; import at.gv.egiz.eaaf.core.exceptions.EaafException; import at.gv.egiz.eaaf.core.exceptions.EaafStorageException; -import at.gv.egiz.eaaf.core.impl.builder.BpkBuilder; import at.gv.egiz.eaaf.core.impl.data.Pair; import at.gv.egiz.eaaf.core.impl.data.Triple; import at.gv.egiz.eaaf.core.impl.idp.AuthenticationData; @@ -223,17 +222,21 @@ public class AuthenticationDataBuilder extends AbstractAuthenticationDataBuilder final String sourcePinType = authProcessData.getGenericDataFromSession( PvpAttributeDefinitions.MANDATE_LEG_PER_SOURCE_PIN_TYPE_NAME, String.class); - // TODO: check if we should to this in such a way! - final Pair<String, String> leagalPersonIdentifier = - BpkBuilder.generateAreaSpecificPersonIdentifier( - sourcePinType + sourcePin, - sourcePinType, - pendingReq.getServiceProviderConfiguration().getAreaSpecificTargetIdentifier()); - + // build leagl-person identifier for eIDAS out-going + final String[] splittedTarget = + pendingReq.getServiceProviderConfiguration().getAreaSpecificTargetIdentifier().split("\\+"); + StringBuilder sb = new StringBuilder(); + sb.append(splittedTarget[1]) + .append("/") + .append(splittedTarget[2]) + .append("/") + .append(sourcePinType) + .append("+") + .append(sourcePin); + log.debug("Use legal-person eIDAS identifer: {} from baseId: {} and baseIdType: {}", - leagalPersonIdentifier.getFirst(), sourcePin, sourcePinType); - authData.setGenericData(MsProxyServiceConstants.ATTR_EIDAS_JUR_MANDATOR_PERSONAL_IDENTIFIER, - leagalPersonIdentifier.getFirst()); + sb.toString(), sourcePin, sourcePinType); + authData.setGenericData(MsProxyServiceConstants.ATTR_EIDAS_JUR_MANDATOR_PERSONAL_IDENTIFIER, sb.toString()); } } diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/utils/AuthenticationDataBuilderTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/utils/AuthenticationDataBuilderTest.java index 277138ef..cd183088 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/utils/AuthenticationDataBuilderTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/utils/AuthenticationDataBuilderTest.java @@ -172,7 +172,7 @@ public class AuthenticationDataBuilderTest { Assert.assertEquals("CitizenCountry", cc, authData.getCiticenCountryCode()); Assert.assertEquals("familyName", familyName, authData.getFamilyName()); Assert.assertEquals("givenName", givenName, authData.getGivenName()); - Assert.assertEquals("DateOfBirth", dateOfBirth, authData.getFormatedDateOfBirth()); + Assert.assertEquals("DateOfBirth", dateOfBirth, authData.getDateOfBirth()); Assert.assertEquals("bPK", pendingReq.getSessionData(AuthProcessDataWrapper.class) .getGenericDataFromSession(MsProxyServiceConstants.ATTR_EIDAS_PERSONAL_IDENTIFIER, String.class), @@ -217,7 +217,7 @@ public class AuthenticationDataBuilderTest { //check mandate informations checkGenericAttribute(authData, PvpAttributeDefinitions.MANDATE_LEG_PER_FULL_NAME_NAME, commonMandate); checkGenericAttribute(authData, MsProxyServiceConstants.ATTR_EIDAS_JUR_MANDATOR_PERSONAL_IDENTIFIER, - "AT/EE/oaAGaV/zIHSf6rcB0TIOqjWPoOU="); + "AT/EE/urn:publicid:gv.at:baseid+XFN+asfdsadfsadfsafsdafsadfasr"); } |