aboutsummaryrefslogtreecommitdiff
path: root/connector
diff options
context:
space:
mode:
authorThomas <>2021-04-29 15:15:44 +0200
committerThomas <>2022-03-03 16:31:56 +0100
commit47c011420675af6e53f8d9019b28558076ff21ef (patch)
tree42dc9e6618787cb957bd981c5ca20c605d578d58 /connector
parent2daed784e006d449de5b6151f6e109ab2a829749 (diff)
downloadNational_eIDAS_Gateway-47c011420675af6e53f8d9019b28558076ff21ef.tar.gz
National_eIDAS_Gateway-47c011420675af6e53f8d9019b28558076ff21ef.tar.bz2
National_eIDAS_Gateway-47c011420675af6e53f8d9019b28558076ff21ef.zip
change eIDAS LegalPersonId from bPK layout to sourcePinType + sourcePin
Diffstat (limited to 'connector')
-rw-r--r--connector/src/main/java/at/asitplus/eidas/specific/connector/builder/AuthenticationDataBuilder.java25
-rw-r--r--connector/src/test/java/at/asitplus/eidas/specific/connector/test/utils/AuthenticationDataBuilderTest.java4
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");
}