diff options
author | Thomas <> | 2022-04-05 10:19:24 +0200 |
---|---|---|
committer | Thomas <> | 2022-04-05 10:19:24 +0200 |
commit | 9e3b78d931d220e1ed5ecbaadcb13df7cbe96e22 (patch) | |
tree | 617892075b8faad92a3f9af1cedcbe64763854c6 /modules/authmodule-eIDAS-v2/src/main/java | |
parent | 95889412fcd40c60072958caffa611c805038b67 (diff) | |
parent | 9d1e1294c2825c6f9a422c9f9c51f9965258d19e (diff) | |
download | National_eIDAS_Gateway-9e3b78d931d220e1ed5ecbaadcb13df7cbe96e22.tar.gz National_eIDAS_Gateway-9e3b78d931d220e1ed5ecbaadcb13df7cbe96e22.tar.bz2 National_eIDAS_Gateway-9e3b78d931d220e1ed5ecbaadcb13df7cbe96e22.zip |
Merge branch 'nightlybuild' into feature/ms_proxy_before_refactoring
Diffstat (limited to 'modules/authmodule-eIDAS-v2/src/main/java')
3 files changed, 42 insertions, 10 deletions
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java index 9ceb08ee..494d4803 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java @@ -139,6 +139,10 @@ public class Constants { public static final String CONIG_PROPS_EIDAS_SZRCLIENT_WORKAROUND_SQLLITEDATASTORE_ACTIVE = CONIG_PROPS_EIDAS_SZRCLIENT + ".workarounds.datastore.sqlite.active"; + public static final String CONIG_PROPS_EIDAS_SZRCLIENT_WORKAROUND_IDA_VSZ_IDL = + CONIG_PROPS_EIDAS_SZRCLIENT + ".workarounds.use.getidentitylink.for.ida"; + + // http endpoint descriptions public static final String eIDAS_HTTP_ENDPOINT_SP_POST = "/eidas/light/sp/post"; public static final String eIDAS_HTTP_ENDPOINT_SP_REDIRECT = "/eidas/light/sp/redirect"; 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 5558fdfd..11ea2843 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 @@ -226,15 +226,15 @@ public class SzrClient { * Request a encryped baseId from SRZ. * * @param personInfo Minimum dataset of person + * @param insertErnp insertErnp flag on SZR request * @return encrypted baseId * @throws SzrCommunicationException In case of a SZR error */ - public String getEncryptedStammzahl(final PersonInfoType personInfo) + public String getEncryptedStammzahl(final PersonInfoType personInfo, boolean insertErnp) throws SzrCommunicationException { - final String resp; try { - resp = this.szr.getStammzahlEncrypted(personInfo, false); + resp = this.szr.getStammzahlEncrypted(personInfo, insertErnp); } catch (SZRException_Exception e) { throw new SzrCommunicationException("ernb.02", new Object[]{e.getMessage()}, e); } @@ -243,7 +243,19 @@ public class SzrClient { throw new SzrCommunicationException("ernb.01", new Object[]{"Stammzahl response empty"}); // TODO error handling } - return resp; + return resp; + } + + /** + * Request a encrypted baseId from SRZ without insertErnp. + * + * @param personInfo Minimum dataset of person + * @return encrypted baseId + * @throws SzrCommunicationException In case of a SZR error + */ + public String getEncryptedStammzahl(final PersonInfoType personInfo) + throws SzrCommunicationException { + return getEncryptedStammzahl(personInfo, false); } 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 18ddab42..ce737526 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 @@ -150,12 +150,9 @@ public class CreateIdentityLinkTask extends AbstractAuthServletTask { 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(buildGetEncryptedBaseIdReq(idlResult.identityLink)); - + // get VSZ + String vsz = getVszForPerson(personInfo); + //write revision-Log entry and extended infos personal-identifier mapping revisionsLogger.logEvent(pendingReq, MsConnectorEventCodes.SZR_VSZ_RECEIVED); writeExtendedRevisionLogEntry(simpleAttrMap, eidData); @@ -224,6 +221,25 @@ public class CreateIdentityLinkTask extends AbstractAuthServletTask { } } + + private String getVszForPerson(PersonInfoType personInfo) throws SzrCommunicationException, EaafException { + if (basicConfig.getBasicConfigurationBoolean( + Constants.CONIG_PROPS_EIDAS_SZRCLIENT_WORKAROUND_IDA_VSZ_IDL, true)) { + log.debug("IDA workaround is active. Requesting IDL to insert person into ERnP .... "); + + // work-around, because getEncryptedStammzahl does not support insertERnP for eIDAS entities + SzrResultHolder idlResult = requestSzrForIdentityLink(personInfo); + + // get encrypted baseId + return szrClient.getEncryptedStammzahl(buildGetEncryptedBaseIdReq(idlResult.identityLink)); + + + } else { + return szrClient.getEncryptedStammzahl(personInfo, true); + + } + } + private PersonInfoType buildGetEncryptedBaseIdReq(IIdentityLink identityLink) throws EaafBuilderException { log.debug("Generating getVsz request from identityLink information ... "); final PersonInfoType personInfo = new PersonInfoType(); |