diff options
author | Thomas <> | 2022-03-17 08:00:03 +0100 |
---|---|---|
committer | Thomas <> | 2022-03-17 08:00:03 +0100 |
commit | c36d00b46a7b628726b640117632b298bf218cf3 (patch) | |
tree | cf010ac43ea0ed4e86ed257ad84d3805978f51ac /eidas_modules/authmodule-eIDAS-v2/src/main/java | |
parent | ae5d022d5c1af5a3edd48c4aecd2e3635cdd4992 (diff) | |
download | National_eIDAS_Gateway-c36d00b46a7b628726b640117632b298bf218cf3.tar.gz National_eIDAS_Gateway-c36d00b46a7b628726b640117632b298bf218cf3.tar.bz2 National_eIDAS_Gateway-c36d00b46a7b628726b640117632b298bf218cf3.zip |
fix(szr): Request getIdentityLinkEidas before getVSZ because getVSZ does not support insertErnp by using eIDAS entities
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main/java')
2 files changed, 35 insertions, 4 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java index 1f5837d6..5558fdfd 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java +++ b/eidas_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/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java index f4849b07..4a501ed6 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java +++ b/eidas_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(), |