aboutsummaryrefslogtreecommitdiff
path: root/modules/authmodule-eIDAS-v2/src/main
diff options
context:
space:
mode:
authorThomas <>2022-03-17 08:06:42 +0100
committerThomas <>2022-03-17 08:06:42 +0100
commit321a2e29b84f441033bec477b2d71eb0a2f75e3f (patch)
tree46c1db299a907a44a72c31f4ba0ddb7aff28bb13 /modules/authmodule-eIDAS-v2/src/main
parent7471d2724a9ade98b30296545c39c7d49c690e10 (diff)
downloadNational_eIDAS_Gateway-321a2e29b84f441033bec477b2d71eb0a2f75e3f.tar.gz
National_eIDAS_Gateway-321a2e29b84f441033bec477b2d71eb0a2f75e3f.tar.bz2
National_eIDAS_Gateway-321a2e29b84f441033bec477b2d71eb0a2f75e3f.zip
fix(szr): Request getIdentityLinkEidas before getVSZ because getVSZ does not support insertErnp by using eIDAS entities
# Conflicts: # modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/SzrClientTestProduction.java # modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/CreateIdentityLinkTaskEidNewTest.java
Diffstat (limited to 'modules/authmodule-eIDAS-v2/src/main')
-rw-r--r--modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java2
-rw-r--r--modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java37
2 files changed, 35 insertions, 4 deletions
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java
index 1f5837d6..5558fdfd 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java
@@ -234,7 +234,7 @@ public class SzrClient {
final String resp;
try {
- resp = this.szr.getStammzahlEncrypted(personInfo, true);
+ resp = this.szr.getStammzahlEncrypted(personInfo, false);
} catch (SZRException_Exception e) {
throw new SzrCommunicationException("ernb.02", new Object[]{e.getMessage()}, e);
}
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java
index 6b1b96de..18ddab42 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java
@@ -55,6 +55,7 @@ import at.asitplus.eidas.specific.modules.auth.eidas.v2.service.ICcSpecificEidPr
import at.asitplus.eidas.specific.modules.auth.eidas.v2.szr.SzrClient;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.utils.EidasResponseUtils;
import at.gv.e_government.reference.namespace.persondata._20020228.AlternativeNameType;
+import at.gv.e_government.reference.namespace.persondata._20020228.IdentificationType;
import at.gv.e_government.reference.namespace.persondata._20020228.PersonNameType;
import at.gv.e_government.reference.namespace.persondata._20020228.PhysicalPersonType;
import at.gv.egiz.eaaf.core.api.data.EaafConstants;
@@ -62,6 +63,7 @@ import at.gv.egiz.eaaf.core.api.data.PvpAttributeDefinitions;
import at.gv.egiz.eaaf.core.api.idp.IConfiguration;
import at.gv.egiz.eaaf.core.api.idp.auth.data.IIdentityLink;
import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext;
+import at.gv.egiz.eaaf.core.exceptions.EaafBuilderException;
import at.gv.egiz.eaaf.core.exceptions.EaafException;
import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException;
import at.gv.egiz.eaaf.core.impl.builder.BpkBuilder;
@@ -147,9 +149,12 @@ public class CreateIdentityLinkTask extends AbstractAuthServletTask {
//request SZR based on IDL or E-ID mode
if (pendingReq.getServiceProviderConfiguration()
.isConfigurationValue(MsEidasNodeConstants.PROP_CONFIG_SP_NEW_EID_MODE, false)) {
-
+
+ // work-around, because getEncryptedStammzahl does not support insertERnP for eIDAS entities
+ SzrResultHolder idlResult = requestSzrForIdentityLink(personInfo);
+
// get encrypted baseId
- String vsz = szrClient.getEncryptedStammzahl(personInfo);
+ String vsz = szrClient.getEncryptedStammzahl(buildGetEncryptedBaseIdReq(idlResult.identityLink));
//write revision-Log entry and extended infos personal-identifier mapping
revisionsLogger.logEvent(pendingReq, MsConnectorEventCodes.SZR_VSZ_RECEIVED);
@@ -219,6 +224,33 @@ public class CreateIdentityLinkTask extends AbstractAuthServletTask {
}
}
+ private PersonInfoType buildGetEncryptedBaseIdReq(IIdentityLink identityLink) throws EaafBuilderException {
+ log.debug("Generating getVsz request from identityLink information ... ");
+ final PersonInfoType personInfo = new PersonInfoType();
+ final PersonNameType personName = new PersonNameType();
+ final PhysicalPersonType naturalPerson = new PhysicalPersonType();
+ IdentificationType bpk = new IdentificationType();
+
+ naturalPerson.setName(personName);
+ personInfo.setPerson(naturalPerson);
+ naturalPerson.setIdentification(bpk);
+
+ // person information
+ personName.setFamilyName(identityLink.getFamilyName());
+ personName.setGivenName(identityLink.getGivenName());
+ naturalPerson.setDateOfBirth(identityLink.getDateOfBirth());
+
+ final Pair<String, String> bpkCalc =
+ BpkBuilder.generateAreaSpecificPersonIdentifier(
+ identityLink.getIdentificationValue(),
+ identityLink.getIdentificationType(),
+ EaafConstants.URN_PREFIX_CDID + "ZP");
+ bpk.setValue(bpkCalc.getFirst());
+ bpk.setType(bpkCalc.getSecond());
+ return personInfo;
+
+ }
+
private void writeExtendedRevisionLogEntry(Map<String, Object> simpleAttrMap, ErnbEidData eidData) {
// write ERnB input-data into revision-log
if (basicConfig.getBasicConfigurationBoolean(
@@ -307,7 +339,6 @@ public class CreateIdentityLinkTask extends AbstractAuthServletTask {
} else {
log.debug("Calculating bPK from baseId ... ");
- new BpkBuilder();
final Pair<String, String> bpkCalc = BpkBuilder
.generateAreaSpecificPersonIdentifier(identityLink.getIdentificationValue(),
identityLink.getIdentificationType(),