From fc88f2f4a3658da627eb65254f80f875b6368569 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 29 Oct 2018 11:20:10 +0100 Subject: update SZR client to new eIDAS specific getIdentityLink request --- .../modules/authmodule_eIDASv2/Constants.java | 1 - .../modules/authmodule_eIDASv2/szr/SZRClient.java | 47 +- .../tasks/CreateIdentityLinkTask.java | 8 +- .../src/main/resources/szr_client/SZR-1.1.WSDL | 939 +++++++++++++++++++++ 4 files changed, 951 insertions(+), 44 deletions(-) create mode 100644 eidas_modules/authmodule-eIDAS-v2/src/main/resources/szr_client/SZR-1.1.WSDL (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main') diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/Constants.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/Constants.java index 2a72228e..7451bfb1 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/Constants.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/Constants.java @@ -67,7 +67,6 @@ public class Constants { public static final String CONIG_PROPS_EIDAS_SZRCLIENT_USETESTSERVICE= CONIG_PROPS_EIDAS_SZRCLIENT + ".useTestService"; public static final String CONIG_PROPS_EIDAS_SZRCLIENT_DEBUG_TRACEMESSAGES= CONIG_PROPS_EIDAS_SZRCLIENT + ".debug.logfullmessages"; public static final String CONIG_PROPS_EIDAS_SZRCLIENT_DEBUG_USEDUMMY= CONIG_PROPS_EIDAS_SZRCLIENT + ".debug.useDummySolution"; - public static final String CONIG_PROPS_EIDAS_SZRCLIENT_DEBUG_INSERTERNB= CONIG_PROPS_EIDAS_SZRCLIENT + ".debug.insertERnB"; public static final String CONIG_PROPS_EIDAS_SZRCLIENT_TIMEOUT_CONNECTION= CONIG_PROPS_EIDAS_SZRCLIENT + ".timeout.connection"; public static final String CONIG_PROPS_EIDAS_SZRCLIENT_TIMEOUT_RESPONSE= CONIG_PROPS_EIDAS_SZRCLIENT + ".timeout.response"; public static final String CONIG_PROPS_EIDAS_SZRCLIENT_ENDPOINT_PROD= CONIG_PROPS_EIDAS_SZRCLIENT + ".endpoint.prod"; diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/szr/SZRClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/szr/SZRClient.java index a372ae15..2003a5eb 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/szr/SZRClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/szr/SZRClient.java @@ -69,7 +69,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.w3._2000._09.xmldsig.KeyValueType; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -83,9 +82,10 @@ import at.gv.egiz.eaaf.core.impl.utils.FileUtils; import at.gv.egiz.eaaf.core.impl.utils.KeyStoreUtils; import szrservices.GetBPK; import szrservices.GetBPKResponse; -import szrservices.GetIdentityLink; -import szrservices.GetIdentityLinkResponse; +import szrservices.GetIdentityLinkEidas; +import szrservices.GetIdentityLinkEidasResponse; import szrservices.IdentityLinkType; +import szrservices.ObjectFactory; import szrservices.PersonInfoType; import szrservices.SZR; import szrservices.SZRException_Exception; @@ -110,38 +110,13 @@ public class SZRClient { private SZRService szrService = null; private String szrURL = null; private QName qname = null; - - /* - * This method does not return a valid signed IDL, because Apache CXF XML parser switch namespaces!!!! - */ -// public IdentityLinkType getIdentityLink(PersonInfoType personInfo, List keyValue, Boolean insertERnP) throws SZRCommunicationException { -// try { -// return szr.getIdentityLink( -// personInfo, -// keyValue, -// insertERnP); -// -// } catch (SZRException_Exception | SOAPFaultException e) { -// log.warn("SZR communication FAILED. Reason: " + e.getMessage(), e); -// throw new SZRCommunicationException("ernb.02", new Object[] {e.getMessage()}, e); -// -// } catch (Exception e) { -// log.warn("SZR communication FAILED. Reason: " + e.getMessage(), e); -// throw new SZRCommunicationException("ernb.02", new Object[] {e.getMessage()}, e); -// -// } -// -// } - public IdentityLinkType getIdentityLinkInRawMode(PersonInfoType personInfo, List keyValue, Boolean insertERnP) throws SZRCommunicationException { + public IdentityLinkType getIdentityLinkInRawMode(PersonInfoType personInfo) throws SZRCommunicationException { try { - GetIdentityLink getIDL = new GetIdentityLink(); - getIDL.setInsertERnP(insertERnP); + GetIdentityLinkEidas getIDL = new GetIdentityLinkEidas(); getIDL.setPersonInfo(personInfo); - if (keyValue != null) - getIDL.getKeyValue().addAll(keyValue); - - JAXBContext jaxbContext = JAXBContext.newInstance(GetIdentityLink.class); + + JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class); Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); @@ -156,9 +131,9 @@ public class SZRClient { log.trace("Receive RAW response from SZR"); byte[] szrResponse = sourceToByteArray(response); - JAXBContext ctx = JAXBContext.newInstance(IdentityLinkType.class - .getPackage().getName()); - GetIdentityLinkResponse jaxbElement = (GetIdentityLinkResponse) ctx + //JAXBContext ctx = JAXBContext.newInstance(IdentityLinkType.class +// .getPackage().getName()); + GetIdentityLinkEidasResponse jaxbElement = (GetIdentityLinkEidasResponse) jaxbContext .createUnmarshaller().unmarshal(new ByteArrayInputStream(szrResponse)); @@ -221,7 +196,7 @@ public class SZRClient { @PostConstruct private void initialize() { log.info("Starting SZR-Client initialization .... "); - URL url = SZRClient.class.getResource("/szr_client/SZR-1.WSDL"); + URL url = SZRClient.class.getResource("/szr_client/SZR-1.1.WSDL"); boolean useTestSZR = basicConfig.getBasicMOAIDConfigurationBoolean( Constants.CONIG_PROPS_EIDAS_SZRCLIENT_USETESTSERVICE, diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/tasks/CreateIdentityLinkTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/tasks/CreateIdentityLinkTask.java index 94ab97d3..de6c51c1 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/tasks/CreateIdentityLinkTask.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/tasks/CreateIdentityLinkTask.java @@ -204,13 +204,7 @@ public class CreateIdentityLinkTask extends AbstractAuthServletTask { } - IdentityLinkType result = szrClient.getIdentityLinkInRawMode( - personInfo, - null, - basicConfig.getBasicMOAIDConfigurationBoolean( - Constants.CONIG_PROPS_EIDAS_SZRCLIENT_DEBUG_INSERTERNB, - true) - ); + IdentityLinkType result = szrClient.getIdentityLinkInRawMode(personInfo); Element idlFromSZR = (Element)result.getAssertion(); identityLink = new SimpleIdentityLinkAssertionParser(idlFromSZR).parseIdentityLink(); diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/szr_client/SZR-1.1.WSDL b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/szr_client/SZR-1.1.WSDL new file mode 100644 index 00000000..3c34458d --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/szr_client/SZR-1.1.WSDL @@ -0,0 +1,939 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3