From 55d809e4b4df5c7ca9ba2bdf371f7f9376302ea8 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Thu, 7 Jan 2021 18:16:45 +0100 Subject: Resolve merge comments --- connector/src/main/resources/properties/status_messages_en.properties | 3 +++ 1 file changed, 3 insertions(+) (limited to 'connector') diff --git a/connector/src/main/resources/properties/status_messages_en.properties b/connector/src/main/resources/properties/status_messages_en.properties index 80228a47..c430fc90 100644 --- a/connector/src/main/resources/properties/status_messages_en.properties +++ b/connector/src/main/resources/properties/status_messages_en.properties @@ -6,6 +6,9 @@ eidas.04=Request contains no sessionToken. Authentication process stops eidas.05=Received eIDAS response-message is not valid. Reason: {0} eidas.06=LoA from eIDAS response-message {0} does not match to requested LoA eidas.07=eIDAS Response attribute-validation FAILED. Attribute:{0} Reason: {1} +eidas.08=An unexpected error occurred. +eidas.09=An error occurred while loading your data from official registers. Please contact the support. + config.01=No configuration-file parameter found. Maybe Java SystemD parameter is missing config.03=Can not load configuration from path {0} (See logs for more details) -- cgit v1.2.3 From f74e02f9f0735ff9a1e897c5eba10f69ff720f8f Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Tue, 12 Jan 2021 13:35:02 +0100 Subject: created tasks and beans --- .../config/templates/chooseOtherLoginMethod.html | 250 +++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 connector/src/test/resources/config/templates/chooseOtherLoginMethod.html (limited to 'connector') diff --git a/connector/src/test/resources/config/templates/chooseOtherLoginMethod.html b/connector/src/test/resources/config/templates/chooseOtherLoginMethod.html new file mode 100644 index 00000000..134f7fba --- /dev/null +++ b/connector/src/test/resources/config/templates/chooseOtherLoginMethod.html @@ -0,0 +1,250 @@ + + + + + + + eIDAS-Login Login-Auswahl + + + + + +
+
+
+ + +

Bundesministerium für Inneres

+
+
+ +
+
+
+
+

Zentraler eIDAS Knoten der Republik Österreich

+

Betrieben durch das Bundesministerium für Inneres

+
+ +

Wählen Sie Ihr Land / Select your country

+ +
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + +
+ + + +
+ +
+
+ +
+
+ + -- cgit v1.2.3 From ed033b4105eec8c00189729bd4b38b17c6b40509 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Thu, 7 Jan 2021 18:16:45 +0100 Subject: Resolve merge comments --- connector/src/main/resources/properties/status_messages_en.properties | 3 +++ 1 file changed, 3 insertions(+) (limited to 'connector') diff --git a/connector/src/main/resources/properties/status_messages_en.properties b/connector/src/main/resources/properties/status_messages_en.properties index 80228a47..c430fc90 100644 --- a/connector/src/main/resources/properties/status_messages_en.properties +++ b/connector/src/main/resources/properties/status_messages_en.properties @@ -6,6 +6,9 @@ eidas.04=Request contains no sessionToken. Authentication process stops eidas.05=Received eIDAS response-message is not valid. Reason: {0} eidas.06=LoA from eIDAS response-message {0} does not match to requested LoA eidas.07=eIDAS Response attribute-validation FAILED. Attribute:{0} Reason: {1} +eidas.08=An unexpected error occurred. +eidas.09=An error occurred while loading your data from official registers. Please contact the support. + config.01=No configuration-file parameter found. Maybe Java SystemD parameter is missing config.03=Can not load configuration from path {0} (See logs for more details) -- cgit v1.2.3 From 0b703512f08bfc1cda18e6688c39fdc536045fdd Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 27 Jan 2021 11:19:29 +0100 Subject: fix problem in jUnit tests that depends on static Apache-Ignite holder in eIDAS Ref. implementation and occurin case of a start-up error --- .../specific/connector/test/FullStartUpAndProcessTest.java | 12 ++++++++++-- .../specific/connector/test/MainClassExecutableModeTest.java | 10 ++++++++-- .../specific/connector/test/MainClassWebAppModeTest.java | 7 +++++++ 3 files changed, 25 insertions(+), 4 deletions(-) (limited to 'connector') diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java index 77037415..fcb0e73a 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java @@ -6,6 +6,7 @@ import static org.powermock.api.mockito.PowerMockito.when; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; +import java.lang.reflect.Field; import java.net.URISyntaxException; import java.util.Map; import java.util.Timer; @@ -71,6 +72,7 @@ import at.gv.egiz.eaaf.modules.pvp2.impl.opensaml.OpenSaml3ResourceAdapter; import at.gv.egiz.eaaf.modules.pvp2.impl.opensaml.initialize.EaafOpenSaml3xInitializer; import at.gv.egiz.eaaf.modules.pvp2.impl.utils.Saml2Utils; import at.gv.egiz.eaaf.modules.pvp2.sp.impl.utils.AssertionAttributeExtractor; +import eu.eidas.auth.cache.IgniteInstanceInitializerSpecificCommunication; import eu.eidas.auth.commons.attribute.AttributeDefinition; import eu.eidas.auth.commons.attribute.ImmutableAttributeMap; import eu.eidas.auth.commons.light.ILightRequest; @@ -151,13 +153,19 @@ public class FullStartUpAndProcessTest { /** * Test shut-down. * - * @throws IOException In case of an error + * @throws Exception In case of an error */ @AfterClass - public static void closeIgniteNode() throws IOException { + public static void closeIgniteNode() throws Exception { System.out.println("Closiong Ignite Node ... "); Ignition.stopAll(true); + + //set Ignite-node holder to 'null' because static holders are shared between different tests + final Field field = IgniteInstanceInitializerSpecificCommunication.class.getDeclaredField("instance"); + field.setAccessible(true); + field.set(null, null); + } /** diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/MainClassExecutableModeTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/MainClassExecutableModeTest.java index 86df55df..708560b2 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/MainClassExecutableModeTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/MainClassExecutableModeTest.java @@ -22,6 +22,7 @@ import org.junit.runners.BlockJUnit4ClassRunner; import at.asitplus.eidas.specific.connector.SpringBootApplicationInitializer; import at.gv.egiz.eaaf.core.impl.logging.DummyStatusMessager; import at.gv.egiz.eaaf.core.impl.logging.LogMessageProviderFactory; +import eu.eidas.auth.cache.IgniteInstanceInitializerSpecificCommunication; import lombok.extern.slf4j.Slf4j; @Slf4j @@ -50,17 +51,22 @@ public class MainClassExecutableModeTest { /** * Initializer. - * @throws InterruptedException In case of an error + * @throws Exception In case of an error * */ @AfterClass - public static void closeIgniteNode() throws InterruptedException { + public static void closeIgniteNode() throws Exception { System.out.println("Closing Ignite Node ... "); log.info("Stopping already running Apache Ignite nodes ... "); Ignition.stopAll(true); Thread.sleep(1000); + //set Ignite-node holder to 'null' because static holders are shared between different tests + final Field field = IgniteInstanceInitializerSpecificCommunication.class.getDeclaredField("instance"); + field.setAccessible(true); + field.set(null, null); + } /** diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/MainClassWebAppModeTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/MainClassWebAppModeTest.java index 07ef4968..79d062ae 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/MainClassWebAppModeTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/MainClassWebAppModeTest.java @@ -22,6 +22,7 @@ import org.junit.runners.BlockJUnit4ClassRunner; import at.asitplus.eidas.specific.connector.SpringBootApplicationInitializer; import at.gv.egiz.eaaf.core.impl.logging.DummyStatusMessager; import at.gv.egiz.eaaf.core.impl.logging.LogMessageProviderFactory; +import eu.eidas.auth.cache.IgniteInstanceInitializerSpecificCommunication; @RunWith(BlockJUnit4ClassRunner.class) public class MainClassWebAppModeTest { @@ -68,6 +69,12 @@ public class MainClassWebAppModeTest { System.clearProperty("eidas.ms.configuration"); SpringBootApplicationInitializer.exit(); + + + //set Ignite-node holder to 'null' because static holders are shared between different tests + final Field field1 = IgniteInstanceInitializerSpecificCommunication.class.getDeclaredField("instance"); + field1.setAccessible(true); + field1.set(null, null); } -- cgit v1.2.3 From cb42a3bce6a63f401750a77008ec69fe731365a1 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Thu, 28 Jan 2021 08:23:51 +0100 Subject: junit keystore and config --- .../config/junit_config_1_springboot.properties | 37 ++++++++++++++++++++ .../config/junit_config_2_springboot.properties | 38 +++++++++++++++++++++ .../src/test/resources/config/keys/junit_test.jks | Bin 0 -> 8410 bytes 3 files changed, 75 insertions(+) create mode 100644 connector/src/test/resources/config/keys/junit_test.jks (limited to 'connector') diff --git a/connector/src/test/resources/config/junit_config_1_springboot.properties b/connector/src/test/resources/config/junit_config_1_springboot.properties index e63cda7b..6bf2d399 100644 --- a/connector/src/test/resources/config/junit_config_1_springboot.properties +++ b/connector/src/test/resources/config/junit_config_1_springboot.properties @@ -81,3 +81,40 @@ eidas.ms.sp.1.pvp2.metadata.url=http://junit.test/metadata eidas.ms.sp.1.policy.allowed.requested.targets=test eidas.ms.sp.1.policy.hasBaseIdTransferRestriction=true +## PVP2 S-Profile client configuration +#eidas.ms.modules.eidascentralauth.keystore.type=jks +#eidas.ms.modules.eidascentralauth.keystore.path=keys/junit.jks1 +#eidas.ms.modules.eidascentralauth.keystore.password=password +#eidas.ms.modules.eidascentralauth.key.metadata.alias=meta +#eidas.ms.modules.eidascentralauth.key.metadata.password=password +#eidas.ms.modules.eidascentralauth.key.signing.alias=sig +#eidas.ms.modules.eidascentralauth.key.signing.password=password +#eidas.ms.modules.eidascentralauth.metadata.validity=24 + +#file:src/test/resources/config/junit_config_1_springboot.properties +#eidas.ms.modules.eidascentralauth.keystore.path=src/test/resources/config/junit_test.jks +eidas.ms.modules.eidascentralauth.keystore.path=keys/junit_test.jks +eidas.ms.modules.eidascentralauth.keystore.password=password +eidas.ms.modules.eidascentralauth.keystore.type=jks + +eidas.ms.modules.eidascentralauth.metadata.sign.alias=meta +eidas.ms.modules.eidascentralauth.metadata.sign.password=password +eidas.ms.modules.eidascentralauth.request.sign.alias=sig +eidas.ms.modules.eidascentralauth.request.sign.password=password +eidas.ms.modules.eidascentralauth.response.encryption.alias=enc +eidas.ms.modules.eidascentralauth.response.encryption.password=password + +eidas.ms.modules.eidascentralauth.truststore.path=src/test/resources/config/junit_test.jks +eidas.ms.modules.eidascentralauth.truststore.password=password +eidas.ms.modules.eidascentralauth.truststore.type=jks + +eidas.ms.modules.eidascentralauth.node.entityId= +eidas.ms.modules.eidascentralauth.node.metadataUrl= + +eidas.ms.modules.eidascentralauth.metadata.organisation.name=JUnit +eidas.ms.modules.eidascentralauth.metadata.organisation.friendyname=For testing with jUnit +eidas.ms.modules.eidascentralauth.metadata.organisation.url=http://junit.test +eidas.ms.modules.eidascentralauth.metadata.contact.givenname=Max +eidas.ms.modules.eidascentralauth.metadata.contact.surname=Mustermann +eidas.ms.modules.eidascentralauth.metadata.contact.email=max@junit.test + diff --git a/connector/src/test/resources/config/junit_config_2_springboot.properties b/connector/src/test/resources/config/junit_config_2_springboot.properties index ecb22dec..da82b92b 100644 --- a/connector/src/test/resources/config/junit_config_2_springboot.properties +++ b/connector/src/test/resources/config/junit_config_2_springboot.properties @@ -81,3 +81,41 @@ eidas.ms.sp.1.pvp2.metadata.url=http://junit.test/metadata eidas.ms.sp.1.policy.allowed.requested.targets=test eidas.ms.sp.1.policy.hasBaseIdTransferRestriction=true + +## PVP2 S-Profile client configuration +#eidas.ms.modules.eidascentralauth.keystore.type=jks +#eidas.ms.modules.eidascentralauth.keystore.path=keys/junit.jks1 +#eidas.ms.modules.eidascentralauth.keystore.password=password +#eidas.ms.modules.eidascentralauth.key.metadata.alias=meta +#eidas.ms.modules.eidascentralauth.key.metadata.password=password +#eidas.ms.modules.eidascentralauth.key.signing.alias=sig +#eidas.ms.modules.eidascentralauth.key.signing.password=password +#eidas.ms.modules.eidascentralauth.metadata.validity=24 + +#file:src/test/resources/config/junit_config_1_springboot.properties +#eidas.ms.modules.eidascentralauth.keystore.path=src/test/resources/config/junit_test.jks +eidas.ms.modules.eidascentralauth.keystore.path=keys/junit_test.jks +eidas.ms.modules.eidascentralauth.keystore.password=password +eidas.ms.modules.eidascentralauth.keystore.type=jks + +eidas.ms.modules.eidascentralauth.metadata.sign.alias=meta +eidas.ms.modules.eidascentralauth.metadata.sign.password=password +eidas.ms.modules.eidascentralauth.request.sign.alias=sig +eidas.ms.modules.eidascentralauth.request.sign.password=password +eidas.ms.modules.eidascentralauth.response.encryption.alias=enc +eidas.ms.modules.eidascentralauth.response.encryption.password=password + +eidas.ms.modules.eidascentralauth.truststore.path=src/test/resources/config/junit_test.jks +eidas.ms.modules.eidascentralauth.truststore.password=password +eidas.ms.modules.eidascentralauth.truststore.type=jks + +eidas.ms.modules.eidascentralauth.node.entityId= +eidas.ms.modules.eidascentralauth.node.metadataUrl= + +eidas.ms.modules.eidascentralauth.metadata.organisation.name=JUnit +eidas.ms.modules.eidascentralauth.metadata.organisation.friendyname=For testing with jUnit +eidas.ms.modules.eidascentralauth.metadata.organisation.url=http://junit.test +eidas.ms.modules.eidascentralauth.metadata.contact.givenname=Max +eidas.ms.modules.eidascentralauth.metadata.contact.surname=Mustermann +eidas.ms.modules.eidascentralauth.metadata.contact.email=max@junit.test + diff --git a/connector/src/test/resources/config/keys/junit_test.jks b/connector/src/test/resources/config/keys/junit_test.jks new file mode 100644 index 00000000..ee6254a9 Binary files /dev/null and b/connector/src/test/resources/config/keys/junit_test.jks differ -- cgit v1.2.3 From 9bb8ba415faee8bd454da6def37daf545bb559e1 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 26 Jan 2021 07:40:01 +0100 Subject: update SAML2 IDP elements of MS-specific Connector to current snapshot version (1.1.12-SNAPSHOT) of eaaf_module_pvp2_idp --- .../resources/specific_eIDAS_connector.beans.xml | 74 ++++++++++------------ .../spring/SpringTest_connector.beans.xml | 15 ++--- 2 files changed, 41 insertions(+), 48 deletions(-) (limited to 'connector') diff --git a/connector/src/main/resources/specific_eIDAS_connector.beans.xml b/connector/src/main/resources/specific_eIDAS_connector.beans.xml index f6fdeefe..c59496b4 100644 --- a/connector/src/main/resources/specific_eIDAS_connector.beans.xml +++ b/connector/src/main/resources/specific_eIDAS_connector.beans.xml @@ -14,106 +14,100 @@ + class="at.asitplus.eidas.specific.connector.config.StaticResourceConfiguration" /> + class="at.asitplus.eidas.specific.connector.controller.ProcessEngineSignalController" /> - - - + + class="at.asitplus.eidas.specific.connector.auth.AuthenticationManager" /> + class="at.asitplus.eidas.specific.connector.builder.AuthenticationDataBuilder" /> + class="at.asitplus.eidas.specific.connector.config.PvpEndPointConfiguration" /> + class="at.asitplus.eidas.specific.connector.provider.PvpEndPointCredentialProvider" /> + class="at.asitplus.eidas.specific.connector.provider.PvpMetadataConfigurationFactory" /> - - - + class="at.asitplus.eidas.specific.connector.controller.Pvp2SProfileEndpoint"> + + + class="at.asitplus.eidas.specific.connector.verification.AuthnRequestValidator" /> - + - - - + class="at.gv.egiz.eaaf.modules.pvp2.idp.impl.MetadataAction"> + - - - + class="at.gv.egiz.eaaf.modules.pvp2.idp.impl.AuthenticationAction"> + + + class="at.gv.egiz.eaaf.core.impl.idp.auth.services.ProtocolAuthenticationService"> + class="at.gv.egiz.eaaf.core.impl.utils.SecurePendingRequestIdGenerationStrategy" /> + class="at.asitplus.eidas.specific.connector.provider.PvpMetadataProvider" /> + class="at.asitplus.eidas.specific.connector.builder.PvpSubjectNameGenerator" /> + class="at.asitplus.eidas.specific.connector.mapper.LoALevelMapper" /> + class="at.asitplus.eidas.specific.connector.gui.GuiBuilderConfigurationFactory" /> + class="at.asitplus.eidas.specific.connector.gui.DefaultVelocityGuiBuilderImpl" /> + class="at.asitplus.eidas.specific.connector.gui.SpringMvcGuiFormBuilderImpl" /> + class="at.asitplus.eidas.specific.connector.provider.StatusMessageProvider" /> + class="at.asitplus.eidas.specific.connector.logger.RevisionLogger" /> + class="at.asitplus.eidas.specific.connector.logger.StatisticLogger" /> + class="at.asitplus.eidas.specific.connector.processes.tasks.GenerateCountrySelectionFrameTask" + scope="prototype" /> + class="at.asitplus.eidas.specific.connector.processes.tasks.EvaluateCountrySelectionTask" + scope="prototype" /> \ No newline at end of file diff --git a/connector/src/test/resources/spring/SpringTest_connector.beans.xml b/connector/src/test/resources/spring/SpringTest_connector.beans.xml index ba385cb9..5819a915 100644 --- a/connector/src/test/resources/spring/SpringTest_connector.beans.xml +++ b/connector/src/test/resources/spring/SpringTest_connector.beans.xml @@ -38,16 +38,16 @@ - - - + + - + + @@ -58,9 +58,8 @@ - - - + + Date: Thu, 28 Jan 2021 10:17:03 +0100 Subject: rename to IdAustriaClient --- .../config/junit_config_1_springboot.properties | 68 +++++++++++----------- .../config/junit_config_2_springboot.properties | 68 +++++++++++----------- 2 files changed, 66 insertions(+), 70 deletions(-) (limited to 'connector') diff --git a/connector/src/test/resources/config/junit_config_1_springboot.properties b/connector/src/test/resources/config/junit_config_1_springboot.properties index 6bf2d399..1cfeef37 100644 --- a/connector/src/test/resources/config/junit_config_1_springboot.properties +++ b/connector/src/test/resources/config/junit_config_1_springboot.properties @@ -82,39 +82,37 @@ eidas.ms.sp.1.policy.allowed.requested.targets=test eidas.ms.sp.1.policy.hasBaseIdTransferRestriction=true ## PVP2 S-Profile client configuration -#eidas.ms.modules.eidascentralauth.keystore.type=jks -#eidas.ms.modules.eidascentralauth.keystore.path=keys/junit.jks1 -#eidas.ms.modules.eidascentralauth.keystore.password=password -#eidas.ms.modules.eidascentralauth.key.metadata.alias=meta -#eidas.ms.modules.eidascentralauth.key.metadata.password=password -#eidas.ms.modules.eidascentralauth.key.signing.alias=sig -#eidas.ms.modules.eidascentralauth.key.signing.password=password -#eidas.ms.modules.eidascentralauth.metadata.validity=24 - -#file:src/test/resources/config/junit_config_1_springboot.properties -#eidas.ms.modules.eidascentralauth.keystore.path=src/test/resources/config/junit_test.jks -eidas.ms.modules.eidascentralauth.keystore.path=keys/junit_test.jks -eidas.ms.modules.eidascentralauth.keystore.password=password -eidas.ms.modules.eidascentralauth.keystore.type=jks - -eidas.ms.modules.eidascentralauth.metadata.sign.alias=meta -eidas.ms.modules.eidascentralauth.metadata.sign.password=password -eidas.ms.modules.eidascentralauth.request.sign.alias=sig -eidas.ms.modules.eidascentralauth.request.sign.password=password -eidas.ms.modules.eidascentralauth.response.encryption.alias=enc -eidas.ms.modules.eidascentralauth.response.encryption.password=password - -eidas.ms.modules.eidascentralauth.truststore.path=src/test/resources/config/junit_test.jks -eidas.ms.modules.eidascentralauth.truststore.password=password -eidas.ms.modules.eidascentralauth.truststore.type=jks - -eidas.ms.modules.eidascentralauth.node.entityId= -eidas.ms.modules.eidascentralauth.node.metadataUrl= - -eidas.ms.modules.eidascentralauth.metadata.organisation.name=JUnit -eidas.ms.modules.eidascentralauth.metadata.organisation.friendyname=For testing with jUnit -eidas.ms.modules.eidascentralauth.metadata.organisation.url=http://junit.test -eidas.ms.modules.eidascentralauth.metadata.contact.givenname=Max -eidas.ms.modules.eidascentralauth.metadata.contact.surname=Mustermann -eidas.ms.modules.eidascentralauth.metadata.contact.email=max@junit.test +#eidas.ms.modules.idaustriaclient.keystore.type=jks +#eidas.ms.modules.idaustriaclient.keystore.path=keys/junit.jks1 +#eidas.ms.modules.idaustriaclient.keystore.password=password +#eidas.ms.modules.idaustriaclient.key.metadata.alias=meta +#eidas.ms.modules.idaustriaclient.key.metadata.password=password +#eidas.ms.modules.idaustriaclient.key.signing.alias=sig +#eidas.ms.modules.idaustriaclient.key.signing.password=password +#eidas.ms.modules.idaustriaclient.metadata.validity=24 + +eidas.ms.modules.idaustriaclient.keystore.path=keys/junit_test.jks +eidas.ms.modules.idaustriaclient.keystore.password=password +eidas.ms.modules.idaustriaclient.keystore.type=jks + +eidas.ms.modules.idaustriaclient.metadata.sign.alias=meta +eidas.ms.modules.idaustriaclient.metadata.sign.password=password +eidas.ms.modules.idaustriaclient.request.sign.alias=sig +eidas.ms.modules.idaustriaclient.request.sign.password=password +eidas.ms.modules.idaustriaclient.response.encryption.alias=enc +eidas.ms.modules.idaustriaclient.response.encryption.password=password + +eidas.ms.modules.idaustriaclient.truststore.path=keys/junit_test.jks +eidas.ms.modules.idaustriaclient.truststore.password=password +eidas.ms.modules.idaustriaclient.truststore.type=jks + +eidas.ms.modules.idaustriaclient.node.entityId= +eidas.ms.modules.idaustriaclient.node.metadataUrl= + +eidas.ms.modules.idaustriaclient.metadata.organisation.name=JUnit +eidas.ms.modules.idaustriaclient.metadata.organisation.friendyname=For testing with jUnit +eidas.ms.modules.idaustriaclient.metadata.organisation.url=http://junit.test +eidas.ms.modules.idaustriaclient.metadata.contact.givenname=Max +eidas.ms.modules.idaustriaclient.metadata.contact.surname=Mustermann +eidas.ms.modules.idaustriaclient.metadata.contact.email=max@junit.test diff --git a/connector/src/test/resources/config/junit_config_2_springboot.properties b/connector/src/test/resources/config/junit_config_2_springboot.properties index da82b92b..4c2be39b 100644 --- a/connector/src/test/resources/config/junit_config_2_springboot.properties +++ b/connector/src/test/resources/config/junit_config_2_springboot.properties @@ -83,39 +83,37 @@ eidas.ms.sp.1.policy.hasBaseIdTransferRestriction=true ## PVP2 S-Profile client configuration -#eidas.ms.modules.eidascentralauth.keystore.type=jks -#eidas.ms.modules.eidascentralauth.keystore.path=keys/junit.jks1 -#eidas.ms.modules.eidascentralauth.keystore.password=password -#eidas.ms.modules.eidascentralauth.key.metadata.alias=meta -#eidas.ms.modules.eidascentralauth.key.metadata.password=password -#eidas.ms.modules.eidascentralauth.key.signing.alias=sig -#eidas.ms.modules.eidascentralauth.key.signing.password=password -#eidas.ms.modules.eidascentralauth.metadata.validity=24 - -#file:src/test/resources/config/junit_config_1_springboot.properties -#eidas.ms.modules.eidascentralauth.keystore.path=src/test/resources/config/junit_test.jks -eidas.ms.modules.eidascentralauth.keystore.path=keys/junit_test.jks -eidas.ms.modules.eidascentralauth.keystore.password=password -eidas.ms.modules.eidascentralauth.keystore.type=jks - -eidas.ms.modules.eidascentralauth.metadata.sign.alias=meta -eidas.ms.modules.eidascentralauth.metadata.sign.password=password -eidas.ms.modules.eidascentralauth.request.sign.alias=sig -eidas.ms.modules.eidascentralauth.request.sign.password=password -eidas.ms.modules.eidascentralauth.response.encryption.alias=enc -eidas.ms.modules.eidascentralauth.response.encryption.password=password - -eidas.ms.modules.eidascentralauth.truststore.path=src/test/resources/config/junit_test.jks -eidas.ms.modules.eidascentralauth.truststore.password=password -eidas.ms.modules.eidascentralauth.truststore.type=jks - -eidas.ms.modules.eidascentralauth.node.entityId= -eidas.ms.modules.eidascentralauth.node.metadataUrl= - -eidas.ms.modules.eidascentralauth.metadata.organisation.name=JUnit -eidas.ms.modules.eidascentralauth.metadata.organisation.friendyname=For testing with jUnit -eidas.ms.modules.eidascentralauth.metadata.organisation.url=http://junit.test -eidas.ms.modules.eidascentralauth.metadata.contact.givenname=Max -eidas.ms.modules.eidascentralauth.metadata.contact.surname=Mustermann -eidas.ms.modules.eidascentralauth.metadata.contact.email=max@junit.test +#eidas.ms.modules.idaustriaclient.keystore.type=jks +#eidas.ms.modules.idaustriaclient.keystore.path=keys/junit.jks1 +#eidas.ms.modules.idaustriaclient.keystore.password=password +#eidas.ms.modules.idaustriaclient.key.metadata.alias=meta +#eidas.ms.modules.idaustriaclient.key.metadata.password=password +#eidas.ms.modules.idaustriaclient.key.signing.alias=sig +#eidas.ms.modules.idaustriaclient.key.signing.password=password +#eidas.ms.modules.idaustriaclient.metadata.validity=24 + +eidas.ms.modules.idaustriaclient.keystore.path=keys/junit_test.jks +eidas.ms.modules.idaustriaclient.keystore.password=password +eidas.ms.modules.idaustriaclient.keystore.type=jks + +eidas.ms.modules.idaustriaclient.metadata.sign.alias=meta +eidas.ms.modules.idaustriaclient.metadata.sign.password=password +eidas.ms.modules.idaustriaclient.request.sign.alias=sig +eidas.ms.modules.idaustriaclient.request.sign.password=password +eidas.ms.modules.idaustriaclient.response.encryption.alias=enc +eidas.ms.modules.idaustriaclient.response.encryption.password=password + +eidas.ms.modules.idaustriaclient.truststore.path=keys/junit_test.jks +eidas.ms.modules.idaustriaclient.truststore.password=password +eidas.ms.modules.idaustriaclient.truststore.type=jks + +eidas.ms.modules.idaustriaclient.node.entityId= +eidas.ms.modules.idaustriaclient.node.metadataUrl= + +eidas.ms.modules.idaustriaclient.metadata.organisation.name=JUnit +eidas.ms.modules.idaustriaclient.metadata.organisation.friendyname=For testing with jUnit +eidas.ms.modules.idaustriaclient.metadata.organisation.url=http://junit.test +eidas.ms.modules.idaustriaclient.metadata.contact.givenname=Max +eidas.ms.modules.idaustriaclient.metadata.contact.surname=Mustermann +eidas.ms.modules.idaustriaclient.metadata.contact.email=max@junit.test -- cgit v1.2.3 From 4c621edbacbaed95edf4cac3a44a84e9e5c55819 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Fri, 29 Jan 2021 17:11:32 +0100 Subject: remove unnecessary classes --- connector/src/test/resources/config/junit_config_1_springboot.properties | 1 + 1 file changed, 1 insertion(+) (limited to 'connector') diff --git a/connector/src/test/resources/config/junit_config_1_springboot.properties b/connector/src/test/resources/config/junit_config_1_springboot.properties index 1cfeef37..fc0c7241 100644 --- a/connector/src/test/resources/config/junit_config_1_springboot.properties +++ b/connector/src/test/resources/config/junit_config_1_springboot.properties @@ -107,6 +107,7 @@ eidas.ms.modules.idaustriaclient.truststore.password=password eidas.ms.modules.idaustriaclient.truststore.type=jks eidas.ms.modules.idaustriaclient.node.entityId= +eidas.ms.modules.idaustriaclient.sp.entityId= eidas.ms.modules.idaustriaclient.node.metadataUrl= eidas.ms.modules.idaustriaclient.metadata.organisation.name=JUnit -- cgit v1.2.3 From de03adfbe79968f65bb711d7b3a583eeb1054140 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Mon, 1 Feb 2021 09:42:38 +0100 Subject: more transitions & tests --- connector/pom.xml | 9 +++++++++ .../src/main/resources/properties/status_messages_en.properties | 1 + 2 files changed, 10 insertions(+) (limited to 'connector') diff --git a/connector/pom.xml b/connector/pom.xml index 36a6d9df..c2039ad7 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -43,6 +43,15 @@ authmodule-eIDAS-v2 + + at.gv.egiz.eaaf + eaaf_module_pvp2_core + + + at.gv.egiz.eaaf + eaaf_module_pvp2_sp + + org.springframework.boot diff --git a/connector/src/main/resources/properties/status_messages_en.properties b/connector/src/main/resources/properties/status_messages_en.properties index c430fc90..9dcbe1a1 100644 --- a/connector/src/main/resources/properties/status_messages_en.properties +++ b/connector/src/main/resources/properties/status_messages_en.properties @@ -8,6 +8,7 @@ eidas.06=LoA from eIDAS response-message {0} does not match to requested LoA eidas.07=eIDAS Response attribute-validation FAILED. Attribute:{0} Reason: {1} eidas.08=An unexpected error occurred. eidas.09=An error occurred while loading your data from official registers. Please contact the support. +eidas.10=Invalid user input. config.01=No configuration-file parameter found. Maybe Java SystemD parameter is missing -- cgit v1.2.3 From ebd7e620fca36b0b545ebcaaaff8d092e1c42e22 Mon Sep 17 00:00:00 2001 From: Christian Kollmann Date: Mon, 22 Feb 2021 10:17:20 +0100 Subject: Fix type in property "gui.countryselection.cancel" --- .../main/resources/templates/countrySelection.html | 170 ++++++++++----------- .../config/properties/messages.properties | 2 +- .../config/properties/messages_de.properties | 2 +- .../config/templates/chooseOtherLoginMethod.html | 2 +- .../config/templates/countrySelection.html | 50 +++--- .../config/templates/countrySelection_example.html | 124 +++++++-------- 6 files changed, 175 insertions(+), 175 deletions(-) (limited to 'connector') diff --git a/connector/src/main/resources/templates/countrySelection.html b/connector/src/main/resources/templates/countrySelection.html index 3937b464..b15234eb 100644 --- a/connector/src/main/resources/templates/countrySelection.html +++ b/connector/src/main/resources/templates/countrySelection.html @@ -3,12 +3,12 @@ xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="fragments/base" th:with="lang=${#locale.language}" th:lang="${lang}"> - + - + eIDAS-Login Länderauswahl @@ -17,236 +17,236 @@
LanguageSelectionBlock
- +

Select your country

- -
+ + Belgium-eID - + - +
- -
+ + Bulgaria-eID - +
- -
+ + Croatia-eID - +
- -
+ + Cyprus-eID + th:attr="src=@{img/countries/Cyprus-EU.png},alt=#{gui.countryselection.country.cy.logo.alt}"/> - +
- -
+ + CzechRepublic-eID - +
- -
+ + Denmark-eID - +
-
+ Germany-eID
- -
+ + Estonia-eID
- -
+ + Finland-eID
- -
+ + France-eID
- -
+ + Greece-eID + th:attr="src=@{img/countries/Greece-EU.png},alt=#{gui.countryselection.country.gr.logo.alt}"/> - +
- -
+ + Hungary-eID + th:attr="src=@{img/countries/Hungary-EU.png},alt=#{gui.countryselection.country.hu.logo.alt}"/>
- -
+ + Ireland-eID
- -
+ + Ireland-eID
- -
+ + Italy-eID
- -
+ + Latvia-eID - +
- -
+ + Luxembourg-eID - +
- -
+ + Luxembourg-eID
- -
+ + Malta-eID
- -
+ + Netherlands-eID - + - +
- -
+ + Poland-eID - +
- -
+ + Portugal-eID + th:attr="src=@{img/countries/Portugal-EU.png},alt=#{gui.countryselection.country.pt.logo.alt}"/> - +
- -
+ + Romania-eID + th:attr="src=@{img/countries/Romania-EU.png},alt=#{gui.countryselection.country.ro.logo.alt}"/> - +
- -
+ + Slovakia-eID - +
- -
+ + Slovenia-eID - +
- -
+ + Spain-eID - +
- -
+ + Sweden-eID - +
- -
+ + UnitedKingdom-eID
- -
- + + +
diff --git a/connector/src/test/resources/config/properties/messages.properties b/connector/src/test/resources/config/properties/messages.properties index ea604cda..9f7f8f7c 100644 --- a/connector/src/test/resources/config/properties/messages.properties +++ b/connector/src/test/resources/config/properties/messages.properties @@ -18,7 +18,7 @@ gui.countryselection.header1=Federal Ministry of Internal Affairs gui.countryselection.header2=Austrian Central eIDAS Node gui.countryselection.header3=Operated by Federal Ministry of Internal Affairs gui.countryselection.header.selection=Select your country -gui.countryselection.cancle=Cancel +gui.countryselection.cancel=Cancel gui.countryselection.notsupportedinfo=If you cannot find your country in this list then your electronic identity (eID) is not yet supported. gui.countryselection.infos.general.header=Information on Logins with European eIDs diff --git a/connector/src/test/resources/config/properties/messages_de.properties b/connector/src/test/resources/config/properties/messages_de.properties index 989b8d9c..41ef2551 100644 --- a/connector/src/test/resources/config/properties/messages_de.properties +++ b/connector/src/test/resources/config/properties/messages_de.properties @@ -18,7 +18,7 @@ gui.countryselection.header1=Bundesministerium für Inneres gui.countryselection.header2=Zentraler eIDAS Knoten der Republik Österreich gui.countryselection.header3=Betrieben durch das Bundesministerium für Inneres gui.countryselection.header.selection=Wählen Sie Ihr Land -gui.countryselection.cancle=Abbrechen +gui.countryselection.cancel=Abbrechen gui.countryselection.notsupportedinfo=Wenn Sie Ihr Land in dieser Aufzählung nicht entdecken, dann wird Ihre elektronische Identität (eID) leider noch nicht unterstützt. gui.countryselection.infos.general.header=Information zur Anmeldung über Europäische eIDs diff --git a/connector/src/test/resources/config/templates/chooseOtherLoginMethod.html b/connector/src/test/resources/config/templates/chooseOtherLoginMethod.html index 134f7fba..3a3f9a4a 100644 --- a/connector/src/test/resources/config/templates/chooseOtherLoginMethod.html +++ b/connector/src/test/resources/config/templates/chooseOtherLoginMethod.html @@ -236,7 +236,7 @@
+ th:attr="value=#{gui.countryselection.cancel}">
diff --git a/connector/src/test/resources/config/templates/countrySelection.html b/connector/src/test/resources/config/templates/countrySelection.html index 7fbc9464..2483030b 100644 --- a/connector/src/test/resources/config/templates/countrySelection.html +++ b/connector/src/test/resources/config/templates/countrySelection.html @@ -2,7 +2,7 @@ + th:with="lang=${#locale.language}" th:lang="${lang}"> @@ -17,17 +17,17 @@ body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } -div.header { +div.header { background-color: #e9ecef; padding-top: 28px; padding-left: 137px; padding-right: 137px; padding-bottom: 12px; } -div.titlebar { +div.titlebar { padding: 0px; } -div.titlebar div { +div.titlebar div { } .hidden { display: none; @@ -40,7 +40,7 @@ ul.nav_oben { } li { display: inline-block; -} +} div.header a { text-decoration: none; color: black; @@ -55,7 +55,7 @@ a { padding-bottom: 20px; } @media only screen and (min-width: 1000px) { - div.header { + div.header { padding-left: 137px; padding-right: 137px; } @@ -69,7 +69,7 @@ a { } } @media only screen and (max-width: 999px) { - div.header { + div.header { padding-left: 1em; padding-right: 1em; } @@ -114,10 +114,10 @@ footer { font-size: 80%; } #countries { - padding-bottom: 40px; + padding-bottom: 40px; } #country { - padding-bottom: 20px; + padding-bottom: 20px; } input[type=submit] { width: inherit; @@ -131,7 +131,7 @@ form { /* Element.closest polyfill - https://developer.mozilla.org/en-US/docs/Web/API/Element/closest License: public domain*/ if (!Element.prototype.matches) - Element.prototype.matches = Element.prototype.msMatchesSelector || + Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; if (!Element.prototype.closest) @@ -141,7 +141,7 @@ if (!Element.prototype.closest) do { if (el.matches(s)) return el; el = el.parentElement || el.parentNode; - } while (el !== null && el.nodeType === 1); + } while (el !== null && el.nodeType === 1); return null; }; @@ -149,7 +149,7 @@ if (!Element.prototype.closest) function clickCountryFlag(element) { if (!element) return false; - var form = element.closest("form"); + var form = element.closest("form"); if (!form) return false; @@ -188,43 +188,43 @@ function clickCountryFlag(element) {

Wählen Sie Ihr Land / Select your country

- +
Germany-eID - - + +
- +
-
- + +
-

Wenn Sie Ihr Land in dieser Aufzählung nicht entdecken ...

- +

Wenn Sie Ihr Land in dieser Aufzählung nicht entdecken ...

+

Information zur Anmeldung über Europäische eIDs

- first part - Bundesministerium für Inneres + first part + Bundesministerium für Inneres second part

- +

third part - eIDAS-Verordnung der Europäischen Union + eIDAS-Verordnung der Europäischen Union fourth part

fived part - sixed part + sixed part

diff --git a/connector/src/test/resources/config/templates/countrySelection_example.html b/connector/src/test/resources/config/templates/countrySelection_example.html index 3b7c2d50..2128f14d 100644 --- a/connector/src/test/resources/config/templates/countrySelection_example.html +++ b/connector/src/test/resources/config/templates/countrySelection_example.html @@ -3,12 +3,12 @@ xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="fragments/base" th:with="lang=${#locale.language}" th:lang="${lang}"> - + - + eIDAS-Login Länderauswahl @@ -17,194 +17,194 @@
LanguageSelectionBlock
- +

Select your country

- +
Germany-eID - + - +
- +
Belgium-eID - +
- +
Bulgaria-eID - +
- +
Croatia-eID - +
- +
Cyprus-eID - + th:attr="src=@{/img/countries/Cyprus-EU_gray.png},alt=#{gui.countryselection.country.cy.logo.alt}"/> +
- +
CzechRepublic-eID - +
- +
Denmark-eID - +
- +
Estonia-eID
- +
Finland-eID
- +
France-eID
- +
Greece-eID - + th:attr="src=@{/img/countries/Greece-EU_gray.png},alt=#{gui.countryselection.country.gr.logo.alt}"/> +
- +
Hungary-eID + th:attr="src=@{/img/countries/Hungary-EU_gray.png},alt=#{gui.countryselection.country.hu.logo.alt}"/>
- +
Ireland-eID
- +
Italy-eID - +
- +
Latvia-eID - +
- +
Luxembourg-eID
- +
Malta-eID
- +
Poland-eID
- +
Portugal-eID - + th:attr="src=@{/img/countries/Portugal-EU_gray.png},alt=#{gui.countryselection.country.pt.logo.alt}"/> +
- +
Romania-eID - + th:attr="src=@{/img/countries/Romania-EU_gray.png},alt=#{gui.countryselection.country.ro.logo.alt}"/> +
- +
Slovakia-eID - +
- +
Slovenia-eID - +
- +
Spain-eID - - +
- +
Sweden-eID - +
- +
TheNetherlands-eID - + th:attr="src=@{/img/countries/TheNetherlands-EU_gray.jpg},alt=#{gui.countryselection.country.nl.logo.alt}"/> +
- +
UnitedKingdom-eID
- +
- -
- + + +
- + -- cgit v1.2.3 From 84244f4ac1909c20ce36531f110705b24edbad12 Mon Sep 17 00:00:00 2001 From: Christian Kollmann Date: Mon, 22 Feb 2021 10:43:57 +0100 Subject: Rename tasks to clarify functionality --- .../config/templates/chooseOtherLoginMethod.html | 250 --------------------- .../config/templates/other_login_method.html | 250 +++++++++++++++++++++ 2 files changed, 250 insertions(+), 250 deletions(-) delete mode 100644 connector/src/test/resources/config/templates/chooseOtherLoginMethod.html create mode 100644 connector/src/test/resources/config/templates/other_login_method.html (limited to 'connector') diff --git a/connector/src/test/resources/config/templates/chooseOtherLoginMethod.html b/connector/src/test/resources/config/templates/chooseOtherLoginMethod.html deleted file mode 100644 index 3a3f9a4a..00000000 --- a/connector/src/test/resources/config/templates/chooseOtherLoginMethod.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - eIDAS-Login Login-Auswahl - - - - - -
-
- - -
-
-
-
-

Zentraler eIDAS Knoten der Republik Österreich

-

Betrieben durch das Bundesministerium für Inneres

-
- -

Wählen Sie Ihr Land / Select your country

- -
- -
- - - -
-
- - - -
-
- - - -
-
- - -
- - - -
- -
-
- -
-
- - diff --git a/connector/src/test/resources/config/templates/other_login_method.html b/connector/src/test/resources/config/templates/other_login_method.html new file mode 100644 index 00000000..3a3f9a4a --- /dev/null +++ b/connector/src/test/resources/config/templates/other_login_method.html @@ -0,0 +1,250 @@ + + + + + + + eIDAS-Login Login-Auswahl + + + + + +
+
+ + +
+
+
+
+

Zentraler eIDAS Knoten der Republik Österreich

+

Betrieben durch das Bundesministerium für Inneres

+
+ +

Wählen Sie Ihr Land / Select your country

+ +
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + +
+ + + +
+ +
+
+ +
+
+ + -- cgit v1.2.3 From cdec2bbf39649f0fbe3d1655f5b47f62a5d0bae6 Mon Sep 17 00:00:00 2001 From: Christian Kollmann Date: Thu, 25 Feb 2021 08:33:16 +0100 Subject: Prepare for Mockito testing of MobilePhoneSignature task --- connector/pom.xml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'connector') diff --git a/connector/pom.xml b/connector/pom.xml index c2039ad7..0386e1f1 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -52,7 +52,7 @@ eaaf_module_pvp2_sp
- + org.springframework.boot spring-boot-starter-actuator @@ -66,7 +66,7 @@ spring-boot-starter-tomcat - + de.codecentric spring-boot-admin-starter-client @@ -94,7 +94,7 @@ org.hibernate.validator hibernate-validator - + @@ -112,7 +112,7 @@ org.springframework.boot spring-boot-starter-test test - + at.gv.egiz.eaaf eaaf_core_utils @@ -135,11 +135,16 @@ spring-boot-starter-tomcat test + + org.springframework.boot + spring-boot-starter-test + test + at.gv.egiz.eaaf eaaf-springboot-utils test - + com.github.skjolber mockito-soap-cxf @@ -161,9 +166,9 @@ com.squareup.okhttp3 mockwebserver test - + - + default @@ -173,7 +178,7 @@ default - + javax.servlet javax.servlet-api @@ -191,12 +196,12 @@ at.gv.egiz.eaaf eaaf-springboot-utils - + - + - + ms_connector -- cgit v1.2.3 From 4c81b6452edfed8821ddcb2e0253fa316acff73f Mon Sep 17 00:00:00 2001 From: Christian Kollmann Date: Thu, 25 Feb 2021 11:47:01 +0100 Subject: Remove dependency to Powermock, everything can be done with Mockito --- connector/pom.xml | 12 -- .../connector/test/FullStartUpAndProcessTest.java | 214 ++++++++++----------- 2 files changed, 107 insertions(+), 119 deletions(-) (limited to 'connector') diff --git a/connector/pom.xml b/connector/pom.xml index 0386e1f1..77651483 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -150,18 +150,6 @@ mockito-soap-cxf test - - org.powermock - powermock-module-junit4 - 2.0.7 - test - - - org.powermock - powermock-api-mockito2 - 2.0.7 - test - com.squareup.okhttp3 mockwebserver diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java index fcb0e73a..37a389b4 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java @@ -1,7 +1,7 @@ package at.asitplus.eidas.specific.connector.test; import static org.mockito.ArgumentMatchers.any; -import static org.powermock.api.mockito.PowerMockito.when; +import static org.mockito.Mockito.when; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -92,7 +92,7 @@ import szrservices.SignContentResponseType; @SpringBootTest @ContextConfiguration(initializers = { org.springframework.boot.context.config.DelegatingApplicationContextInitializer.class, - SpringBootApplicationContextInitializer.class + SpringBootApplicationContextInitializer.class }) @TestPropertySource(locations = { "file:src/test/resources/config/junit_config_1_springboot.properties" }) @DirtiesContext(classMode = ClassMode.AFTER_CLASS) @@ -100,23 +100,23 @@ import szrservices.SignContentResponseType; public class FullStartUpAndProcessTest { private static final String FINAL_REDIRECT = "http://localhost/finalizeAuthProtocol?pendingid="; - + @Autowired private WebApplicationContext wac; @Autowired private PvpEndPointCredentialProvider credentialProvider; @Autowired private PvpMetadataProvider metadataProvider; @Autowired private ResourceLoader resourceLoader; @Autowired private EidasAttributeRegistry attrRegistry; - + @Autowired private Pvp2SProfileEndpoint sProfile; @Autowired private ProcessEngineSignalController signal; @Autowired private EidasSignalServlet eidasSignal; @Autowired private ProtocolFinalizationController finalize; - + @Rule public final SoapServiceRule soap = SoapServiceRule.newInstance(); - + private SZR szrMock; - + private String cc; private String givenName; private String familyName; @@ -124,8 +124,8 @@ public class FullStartUpAndProcessTest { private String personalId; private String vsz; private String eidasBind; - - + + /** * jUnit class initializer. * @throws InterruptedException In case of an error @@ -137,7 +137,7 @@ public class FullStartUpAndProcessTest { public static void classInitializer() throws InterruptedException, InitializationException, ComponentInitializationException { final String current = new java.io.File(".").toURI().toString(); System.clearProperty("eidas.ms.configuration"); - + //eIDAS Ref. Impl. properties System.setProperty("EIDAS_CONFIG_REPOSITORY", current.substring("file:".length()) + "../basicConfig/eIDAS/"); @@ -145,11 +145,11 @@ public class FullStartUpAndProcessTest { + "../basicConfig/eIDAS/"); System.setProperty("SPECIFIC_PROXY_SERVICE_CONFIG_REPOSITORY", current.substring("file:".length()) + "../basicConfig/eIDAS/"); - + EaafOpenSaml3xInitializer.eaafInitialize(); - + } - + /** * Test shut-down. * @@ -160,12 +160,12 @@ public class FullStartUpAndProcessTest { System.out.println("Closiong Ignite Node ... "); Ignition.stopAll(true); - + //set Ignite-node holder to 'null' because static holders are shared between different tests final Field field = IgniteInstanceInitializerSpecificCommunication.class.getDeclaredField("instance"); field.setAccessible(true); field.set(null, null); - + } /** @@ -181,27 +181,27 @@ public class FullStartUpAndProcessTest { for (FilterRegistrationBean filter : filters.values()) { if (filter.isEnabled()) { builder.addFilter(filter.getFilter(), "/*"); - + } } szrMock = soap.mock(SZR.class, "http://localhost:1234/demoszr"); - - - + + + cc = RandomStringUtils.randomAlphabetic(2).toUpperCase(); personalId = cc + "/AT/" + RandomStringUtils.randomNumeric(64); familyName = RandomStringUtils.randomAlphabetic(10); givenName = RandomStringUtils.randomAlphabetic(10); dateOfBirth = "2015-10-12"; - + vsz = RandomStringUtils.randomNumeric(10); eidasBind = RandomStringUtils.randomAlphanumeric(50); - + } - + @Test - public void userStopProcess() throws UnsupportedEncodingException, XMLParserException, UnmarshallingException, + public void userStopProcess() throws UnsupportedEncodingException, XMLParserException, UnmarshallingException, TransformerException, IOException, MarshallingException, ComponentInitializationException, EaafException { //start authentication process by sending a SAML2 Authn-Request MockHttpServletRequest saml2Req = new MockHttpServletRequest("POST", "https://localhost/ms_connector"); @@ -209,74 +209,74 @@ public class FullStartUpAndProcessTest { MockHttpServletResponse selectCountryResp = new MockHttpServletResponse(); RequestContextHolder.resetRequestAttributes(); RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(saml2Req, selectCountryResp)); - - // send SAML2 AuthnRequest + + // send SAML2 AuthnRequest sProfile.pvpIdpPostRequest(saml2Req, selectCountryResp); - + //check country-selection response Assert.assertEquals("no country-selection page", 200, selectCountryResp.getStatus()); Assert.assertEquals("cc-selection page", "text/html;charset=UTF-8", selectCountryResp.getContentType()); String selectionPage = selectCountryResp.getContentAsString(); Assert.assertNotNull("selectionPage is null", selectionPage); Assert.assertFalse("selectionPage is empty", selectionPage.isEmpty()); - - String pendingReqId = extractRequestToken(selectionPage, + + String pendingReqId = extractRequestToken(selectionPage, " attributeDef4 = attrRegistry.getCoreAttributeRegistry().getByFriendlyName( Constants.eIDAS_ATTR_DATEOFBIRTH).first(); - + final ImmutableAttributeMap attributeMap = ImmutableAttributeMap.builder() .put(attributeDef, personalId) .put(attributeDef2, familyName) @@ -454,40 +454,40 @@ public class FullStartUpAndProcessTest { .levelOfAssurance(EaafConstants.EIDAS_LOA_HIGH) .attributes(attributeMap) .build(); - + } - + private String extractRequestToken(String selectionPage, String selector) { int start = selectionPage.indexOf(selector); Assert.assertTrue("find no pendingReqId location start", start > 0); int end = selectionPage.indexOf("\"", start + selector.length()); Assert.assertTrue("find no pendingReqId location end", end > 0); return selectionPage.substring(start + selector.length(), end); - + } - private void injectSaml2AuthnReq(MockHttpServletRequest saml2Req) throws XMLParserException, UnmarshallingException, - SamlSigningException, CredentialsNotAvailableException, UnsupportedEncodingException, TransformerException, + private void injectSaml2AuthnReq(MockHttpServletRequest saml2Req) throws XMLParserException, UnmarshallingException, + SamlSigningException, CredentialsNotAvailableException, UnsupportedEncodingException, TransformerException, IOException, MarshallingException, ComponentInitializationException { final RequestAbstractType authnReq = (RequestAbstractType) XMLObjectSupport.unmarshallFromInputStream( XMLObjectProviderRegistrySupport.getParserPool(), Pvp2SProfileEndPointTest.class.getResourceAsStream("/data/pvp2_authn_1.xml")); - authnReq.setIssueInstant(DateTime.now()); - RequestAbstractType signedAuthnReq = - Saml2Utils.signSamlObject(authnReq, credentialProvider.getMessageSigningCredential(), true); + authnReq.setIssueInstant(DateTime.now()); + RequestAbstractType signedAuthnReq = + Saml2Utils.signSamlObject(authnReq, credentialProvider.getMessageSigningCredential(), true); String b64 = Base64Utils.encodeToString(DomUtils.serializeNode( - XMLObjectSupport.getMarshaller(signedAuthnReq).marshall(signedAuthnReq)).getBytes("UTF-8")); + XMLObjectSupport.getMarshaller(signedAuthnReq).marshall(signedAuthnReq)).getBytes("UTF-8")); saml2Req.setParameter("SAMLRequest", b64); - + final org.springframework.core.io.Resource resource = resourceLoader.getResource( "classpath:/data/metadata_valid_without_encryption.xml"); Timer timer = new Timer("PVP metadata-resolver refresh"); - ResourceBackedMetadataResolver fileSystemResolver = + ResourceBackedMetadataResolver fileSystemResolver = new ResourceBackedMetadataResolver(timer, new OpenSaml3ResourceAdapter(resource)); fileSystemResolver.setId("test"); fileSystemResolver.setParserPool(XMLObjectProviderRegistrySupport.getParserPool()); - fileSystemResolver.initialize(); + fileSystemResolver.initialize(); metadataProvider.addMetadataResolverIntoChain(fileSystemResolver); - + } } -- cgit v1.2.3 From b9bc937ff9471c60ced2ef9ed7df526cf31059db Mon Sep 17 00:00:00 2001 From: Christian Kollmann Date: Thu, 4 Mar 2021 14:00:53 +0100 Subject: Document input, output, transitions for each task --- connector/src/test/resources/config/templates/other_login_method.html | 1 + 1 file changed, 1 insertion(+) (limited to 'connector') diff --git a/connector/src/test/resources/config/templates/other_login_method.html b/connector/src/test/resources/config/templates/other_login_method.html index 3a3f9a4a..56c368c6 100644 --- a/connector/src/test/resources/config/templates/other_login_method.html +++ b/connector/src/test/resources/config/templates/other_login_method.html @@ -231,6 +231,7 @@ + -- cgit v1.2.3 From 9f0fa316c8f7adeb3529cb4c3b2c553f085f7d95 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Tue, 15 Jun 2021 12:14:51 +0200 Subject: add ZMR client, to some re-factoring, and a lot of bug-fixing --- .../src/main/resources/application.properties | 14 +++++ .../properties/status_messages_en.properties | 5 +- .../connector/test/FullStartUpAndProcessTest.java | 69 ++++++++++++++++++++-- .../ProcessEngineSignalControllerTest.java | 2 +- .../config/junit_config_1_springboot.properties | 12 ++++ .../config/junit_config_2_springboot.properties | 12 ++++ 6 files changed, 105 insertions(+), 9 deletions(-) (limited to 'connector') diff --git a/connector/src/main/resources/application.properties b/connector/src/main/resources/application.properties index b13b6c18..e9c3afd1 100644 --- a/connector/src/main/resources/application.properties +++ b/connector/src/main/resources/application.properties @@ -82,6 +82,20 @@ eidas.ms.auth.eIDAS.szrclient.eidasbind.mds.inject=false #eidas.ms.auth.eIDAS.authblock.key.password=f/+saJBc3a}*/T^s + +#### matching###### +# ZMR communication +#eidas.ms.auth.eIDAS.zmrclient.endpoint=http://localhost:1234/demozmr +#eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.type=jks +#eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.path=keys/junit.jks +#eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.password=password +#eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.path= +#eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.password= + +#eidas.ms.auth.eIDAS.zmrclient.req.organisation.behoerdennr=jUnit123456 + + + #Raw eIDAS Id data storage eidas.ms.auth.eIDAS.szrclient.workarounds.eidmapping.revisionlog.active=true diff --git a/connector/src/main/resources/properties/status_messages_en.properties b/connector/src/main/resources/properties/status_messages_en.properties index 9dcbe1a1..f07a8705 100644 --- a/connector/src/main/resources/properties/status_messages_en.properties +++ b/connector/src/main/resources/properties/status_messages_en.properties @@ -5,10 +5,7 @@ eidas.03=No CitizenCountry available. Can not start eIDAS authentication process eidas.04=Request contains no sessionToken. Authentication process stops eidas.05=Received eIDAS response-message is not valid. Reason: {0} eidas.06=LoA from eIDAS response-message {0} does not match to requested LoA -eidas.07=eIDAS Response attribute-validation FAILED. Attribute:{0} Reason: {1} -eidas.08=An unexpected error occurred. -eidas.09=An error occurred while loading your data from official registers. Please contact the support. -eidas.10=Invalid user input. +eidas.07=eIDAS Response attribute-validation FAILED. Attribute:{0} Reason: {1}. config.01=No configuration-file parameter found. Maybe Java SystemD parameter is missing diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java index 37a389b4..b4f39985 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java @@ -7,6 +7,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.lang.reflect.Field; +import java.math.BigInteger; import java.net.URISyntaxException; import java.util.Map; import java.util.Timer; @@ -60,6 +61,18 @@ import at.asitplus.eidas.specific.connector.test.saml2.Pvp2SProfileEndPointTest; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.EidasSignalServlet; import at.asitplus.eidas.specific.modules.auth.eidas.v2.service.EidasAttributeRegistry; +import at.gv.bmi.namespace.zmr_su.base._20040201.ResponseType; +import at.gv.bmi.namespace.zmr_su.base._20040201.WorkflowInfoServer; +import at.gv.bmi.namespace.zmr_su.base._20040201_.ServicePort; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.EidasIdentitaetErgebnisType; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.NatuerlichePersonErgebnisType; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.NatuerlichePersonErgebnisType.PersonenName; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.PersonErgebnisSatzType; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.PersonErgebnisType; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.PersonSuchenResponse; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.Personendaten; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.PersonensuchergebnisType; +import at.gv.e_government.reference.namespace.persondata.de._20040201.IdentificationType; import at.gv.egiz.components.spring.api.SpringBootApplicationContextInitializer; import at.gv.egiz.eaaf.core.api.data.EaafConstants; import at.gv.egiz.eaaf.core.exceptions.EaafException; @@ -99,7 +112,7 @@ import szrservices.SignContentResponseType; @ActiveProfiles(profiles = {"JUNIT", "jUnitTestMode"}) public class FullStartUpAndProcessTest { - private static final String FINAL_REDIRECT = "http://localhost/finalizeAuthProtocol?pendingid="; + private static final String FINAL_REDIRECT = "http://localhost/public/secure/finalizeAuthProtocol?pendingid="; @Autowired private WebApplicationContext wac; @Autowired private PvpEndPointCredentialProvider credentialProvider; @@ -116,6 +129,7 @@ public class FullStartUpAndProcessTest { public final SoapServiceRule soap = SoapServiceRule.newInstance(); private SZR szrMock; + private ServicePort zmrClient; private String cc; private String givenName; @@ -186,7 +200,7 @@ public class FullStartUpAndProcessTest { } szrMock = soap.mock(SZR.class, "http://localhost:1234/demoszr"); - + zmrClient = soap.mock(ServicePort.class, "http://localhost:1234/demozmr"); cc = RandomStringUtils.randomAlphabetic(2).toUpperCase(); @@ -337,8 +351,9 @@ public class FullStartUpAndProcessTest { RequestContextHolder.resetRequestAttributes(); RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(eidasNodeRespReq, finalizeResp)); - injectSzrResponse(); - + injectZmrResponse(); + injectSzrResponse(); + //excute eIDAS node response eidasSignal.restoreEidasAuthProcess(eidasNodeRespReq, finalizeResp); @@ -405,6 +420,52 @@ public class FullStartUpAndProcessTest { when(szrMock.signContent(any(), any(), any())).thenReturn(signContentResp); } + + private void injectZmrResponse() throws Exception { + ResponseType resp = new ResponseType(); + + WorkflowInfoServer workflow = new WorkflowInfoServer(); + workflow.setProzessInstanzID(new BigInteger(RandomStringUtils.randomNumeric(10))); + resp.setWorkflowInfoServer(workflow); + + PersonSuchenResponse persRespObj = new PersonSuchenResponse(); + PersonensuchergebnisType searchResult = new PersonensuchergebnisType(); + PersonErgebnisSatzType personInfoObj = new PersonErgebnisSatzType(); + resp.setPersonSuchenResponse(persRespObj); + persRespObj.setPersonensuchergebnis(searchResult); + + searchResult.setGefundeneSaetzeERnP(0); + searchResult.setGefundeneSaetze(1); + searchResult.getPersonErgebnisSatz().add(personInfoObj); + + PersonErgebnisType personInfo = new PersonErgebnisType(); + Personendaten personDataObj = new Personendaten(); + personInfoObj.setPersonendaten(personDataObj); + personDataObj.getPersonErgebnis().add(personInfo); + + EidasIdentitaetErgebnisType eidasPersonalIdentifier = new EidasIdentitaetErgebnisType(); + personInfo.getEidasIdentitaet().add(eidasPersonalIdentifier); + eidasPersonalIdentifier.setDokumentNummer(personalId); + eidasPersonalIdentifier.setEidasArt(Constants.eIDAS_ATTRURN_PERSONALIDENTIFIER); + eidasPersonalIdentifier.setStaatscode3(cc); + + NatuerlichePersonErgebnisType natInfo = new NatuerlichePersonErgebnisType(); + IdentificationType bpk = new IdentificationType(); + PersonenName natName = new PersonenName(); + natInfo.getIdentification().add(bpk); + natInfo.setPersonenName(natName); + personInfo.setNatuerlichePerson(natInfo); + + bpk.setType(EaafConstants.URN_PREFIX_CDID + "ZP"); + bpk.setValue(RandomStringUtils.randomAlphabetic(10)); + natInfo.setGeburtsdatum(dateOfBirth); + natName.setFamilienname(familyName); + natName.setVorname(givenName); + + when(zmrClient.service(any(), any())).thenReturn(resp); + + } + private String validateEidasNodeRequestAndBuildResponse(String eidasNodeReqToken) throws SpecificCommunicationException, URISyntaxException { diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/controller/ProcessEngineSignalControllerTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/controller/ProcessEngineSignalControllerTest.java index d2c4aff2..546d2824 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/controller/ProcessEngineSignalControllerTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/controller/ProcessEngineSignalControllerTest.java @@ -69,7 +69,7 @@ public class ProcessEngineSignalControllerTest { Assert.assertEquals("http StatusCode", 302, httpResp.getStatus()); Assert.assertNotNull("redirect header", httpResp.getHeaderValue("Location")); Assert.assertTrue("wrong redirect header", - httpResp.getHeader("Location").startsWith("http://localhost/errorHandling?errorid=")); + httpResp.getHeader("Location").startsWith("http://localhost//public/secure/errorHandling?errorid=")); } diff --git a/connector/src/test/resources/config/junit_config_1_springboot.properties b/connector/src/test/resources/config/junit_config_1_springboot.properties index fc0c7241..9e4ec415 100644 --- a/connector/src/test/resources/config/junit_config_1_springboot.properties +++ b/connector/src/test/resources/config/junit_config_1_springboot.properties @@ -43,6 +43,18 @@ eidas.ms.auth.eIDAS.szrclient.debug.logfullmessages=true eidas.ms.auth.eIDAS.szrclient.debug.useDummySolution=false +#### matching###### +# ZMR communication +eidas.ms.auth.eIDAS.zmrclient.endpoint=http://localhost:1234/demozmr +eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.type=jks +eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.path=keys/junit.jks +eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.password=password +eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.path= +eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.password= + +eidas.ms.auth.eIDAS.zmrclient.req.organisation.behoerdennr=jUnit123456 + + ## PVP2 S-Profile end-point configuration eidas.ms.pvp2.keystore.type=jks diff --git a/connector/src/test/resources/config/junit_config_2_springboot.properties b/connector/src/test/resources/config/junit_config_2_springboot.properties index 4c2be39b..2300630f 100644 --- a/connector/src/test/resources/config/junit_config_2_springboot.properties +++ b/connector/src/test/resources/config/junit_config_2_springboot.properties @@ -43,6 +43,18 @@ eidas.ms.auth.eIDAS.szrclient.debug.logfullmessages=true eidas.ms.auth.eIDAS.szrclient.debug.useDummySolution=false +#### matching###### +# ZMR communication +eidas.ms.auth.eIDAS.zmrclient.endpoint=http://localhost:1234/demozmr +eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.type=jks +eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.path=keys/junit.jks +eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.password=password +eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.path= +eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.password= + +eidas.ms.auth.eIDAS.zmrclient.req.organisation.behoerdennr=jUnit123456 + + ## PVP2 S-Profile end-point configuration eidas.ms.pvp2.keystore.type=jks -- cgit v1.2.3 From 1c6eba08f2a1c8008b85a71bc2c5d0a9d5e50361 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Tue, 15 Jun 2021 12:30:30 +0200 Subject: fix some warning in maven build process and switch to another GitLab CI maven image --- connector/pom.xml | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'connector') diff --git a/connector/pom.xml b/connector/pom.xml index 77651483..bbc54443 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -125,21 +125,11 @@ test test-jar - - at.gv.egiz.eaaf - eaaf_module_pvp2_sp - test - org.springframework.boot spring-boot-starter-tomcat test - - org.springframework.boot - spring-boot-starter-test - test - at.gv.egiz.eaaf eaaf-springboot-utils -- cgit v1.2.3 From 6e1a69773284177a0f6c7233c4bcdf7f4bd96681 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Tue, 15 Jun 2021 18:15:19 +0200 Subject: further optimizations and bug fixing in matching code --- .../eidas/specific/connector/provider/StatusMessageProvider.java | 8 +++----- connector/src/main/resources/specific_eIDAS_connector.beans.xml | 3 +++ .../eidas/specific/connector/test/FullStartUpAndProcessTest.java | 7 +++++++ .../test/controller/ProcessEngineSignalControllerTest.java | 2 +- .../connector/test/utils/AuthenticationDataBuilderTest.java | 4 ++-- .../src/test/resources/spring/SpringTest_connector.beans.xml | 3 +++ 6 files changed, 19 insertions(+), 8 deletions(-) (limited to 'connector') diff --git a/connector/src/main/java/at/asitplus/eidas/specific/connector/provider/StatusMessageProvider.java b/connector/src/main/java/at/asitplus/eidas/specific/connector/provider/StatusMessageProvider.java index 073f7513..55ce044d 100644 --- a/connector/src/main/java/at/asitplus/eidas/specific/connector/provider/StatusMessageProvider.java +++ b/connector/src/main/java/at/asitplus/eidas/specific/connector/provider/StatusMessageProvider.java @@ -92,14 +92,12 @@ public class StatusMessageProvider implements IStatusMessenger { @Override public String getResponseErrorCode(Throwable throwable) { - String errorCode = IStatusMessenger.CODES_EXTERNAL_ERROR_GENERIC; if (throwable instanceof EaafException) { - errorCode = mapInternalErrorToExternalError(((EaafException) throwable).getErrorId()); - + return ((EaafException) throwable).getErrorId(); + } - // TODO: maybe more internal switches are required - return errorCode; + return IStatusMessenger.CODES_INTERNAL_ERROR_GENERIC; } diff --git a/connector/src/main/resources/specific_eIDAS_connector.beans.xml b/connector/src/main/resources/specific_eIDAS_connector.beans.xml index c59496b4..4608086e 100644 --- a/connector/src/main/resources/specific_eIDAS_connector.beans.xml +++ b/connector/src/main/resources/specific_eIDAS_connector.beans.xml @@ -24,6 +24,9 @@
+ + diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java index b4f39985..61312c3e 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java @@ -57,6 +57,7 @@ import at.asitplus.eidas.specific.connector.controller.ProcessEngineSignalContro import at.asitplus.eidas.specific.connector.controller.Pvp2SProfileEndpoint; import at.asitplus.eidas.specific.connector.provider.PvpEndPointCredentialProvider; import at.asitplus.eidas.specific.connector.provider.PvpMetadataProvider; +import at.asitplus.eidas.specific.connector.provider.StatusMessageProvider; import at.asitplus.eidas.specific.connector.test.saml2.Pvp2SProfileEndPointTest; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.EidasSignalServlet; @@ -74,9 +75,11 @@ import at.gv.bmi.namespace.zmr_su.zmr._20040201.Personendaten; import at.gv.bmi.namespace.zmr_su.zmr._20040201.PersonensuchergebnisType; import at.gv.e_government.reference.namespace.persondata.de._20040201.IdentificationType; import at.gv.egiz.components.spring.api.SpringBootApplicationContextInitializer; +import at.gv.egiz.eaaf.core.api.IStatusMessenger; import at.gv.egiz.eaaf.core.api.data.EaafConstants; import at.gv.egiz.eaaf.core.exceptions.EaafException; import at.gv.egiz.eaaf.core.impl.idp.controller.ProtocolFinalizationController; +import at.gv.egiz.eaaf.core.impl.logging.LogMessageProviderFactory; import at.gv.egiz.eaaf.core.impl.utils.DomUtils; import at.gv.egiz.eaaf.core.impl.utils.Random; import at.gv.egiz.eaaf.modules.pvp2.exception.CredentialsNotAvailableException; @@ -125,6 +128,8 @@ public class FullStartUpAndProcessTest { @Autowired private EidasSignalServlet eidasSignal; @Autowired private ProtocolFinalizationController finalize; + @Autowired private IStatusMessenger messager; + @Rule public final SoapServiceRule soap = SoapServiceRule.newInstance(); @@ -199,6 +204,8 @@ public class FullStartUpAndProcessTest { } } + LogMessageProviderFactory.setStatusMessager(messager); + szrMock = soap.mock(SZR.class, "http://localhost:1234/demoszr"); zmrClient = soap.mock(ServicePort.class, "http://localhost:1234/demozmr"); diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/controller/ProcessEngineSignalControllerTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/controller/ProcessEngineSignalControllerTest.java index 546d2824..5b612036 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/controller/ProcessEngineSignalControllerTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/controller/ProcessEngineSignalControllerTest.java @@ -69,7 +69,7 @@ public class ProcessEngineSignalControllerTest { Assert.assertEquals("http StatusCode", 302, httpResp.getStatus()); Assert.assertNotNull("redirect header", httpResp.getHeaderValue("Location")); Assert.assertTrue("wrong redirect header", - httpResp.getHeader("Location").startsWith("http://localhost//public/secure/errorHandling?errorid=")); + httpResp.getHeader("Location").startsWith("http://localhost/public/secure/errorHandling?errorid=")); } 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 5f1c5dcf..f4b8e57c 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 @@ -42,7 +42,7 @@ import at.gv.egiz.eaaf.core.exceptions.EaafAuthenticationException; import at.gv.egiz.eaaf.core.exceptions.EaafBuilderException; import at.gv.egiz.eaaf.core.exceptions.EaafParserException; import at.gv.egiz.eaaf.core.exceptions.EaafStorageException; -import at.gv.egiz.eaaf.core.impl.idp.auth.builder.BpkBuilder; +import at.gv.egiz.eaaf.core.impl.builder.BpkBuilder; import at.gv.egiz.eaaf.core.impl.idp.auth.data.AuthProcessDataWrapper; import at.gv.egiz.eaaf.core.impl.idp.auth.data.SimpleIdentityLinkAssertionParser; import at.gv.egiz.eaaf.core.impl.idp.module.test.DummySpConfiguration; @@ -185,7 +185,7 @@ public class AuthenticationDataBuilderTest { Assert.assertEquals("FamilyName", idl.getFamilyName(), authData.getFamilyName()); Assert.assertEquals("GivenName", idl.getGivenName(), authData.getGivenName()); - Assert.assertEquals("DateOfBirth", idl.getDateOfBirth(), authData.getFormatedDateOfBirth()); + Assert.assertEquals("DateOfBirth", idl.getDateOfBirth(), authData.getDateOfBirth()); Assert.assertEquals("bPK", BpkBuilder.generateAreaSpecificPersonIdentifier( idl.getIdentificationValue(), EaafConstants.URN_PREFIX_CDID + "XX").getFirst(), diff --git a/connector/src/test/resources/spring/SpringTest_connector.beans.xml b/connector/src/test/resources/spring/SpringTest_connector.beans.xml index 5819a915..ac5455d3 100644 --- a/connector/src/test/resources/spring/SpringTest_connector.beans.xml +++ b/connector/src/test/resources/spring/SpringTest_connector.beans.xml @@ -15,6 +15,9 @@ + + -- cgit v1.2.3 From 249e3805da249afafe164ae7dc43884ba3777727 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Wed, 16 Jun 2021 11:51:11 +0200 Subject: add ZMR update process into ZMRClient --- connector/src/main/resources/application.properties | 2 ++ .../src/test/resources/config/junit_config_1_springboot.properties | 1 + .../src/test/resources/config/junit_config_2_springboot.properties | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'connector') diff --git a/connector/src/main/resources/application.properties b/connector/src/main/resources/application.properties index e9c3afd1..8263ea82 100644 --- a/connector/src/main/resources/application.properties +++ b/connector/src/main/resources/application.properties @@ -93,6 +93,8 @@ eidas.ms.auth.eIDAS.szrclient.eidasbind.mds.inject=false #eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.password= #eidas.ms.auth.eIDAS.zmrclient.req.organisation.behoerdennr=jUnit123456 +#eidas.ms.auth.eIDAS.zmrclient.req.update.reason.code=EIDAS-KITT +#eidas.ms.auth.eIDAS.zmrclient.req.update.reason.text=KITT for eIDAS Matching diff --git a/connector/src/test/resources/config/junit_config_1_springboot.properties b/connector/src/test/resources/config/junit_config_1_springboot.properties index 9e4ec415..3544c3a9 100644 --- a/connector/src/test/resources/config/junit_config_1_springboot.properties +++ b/connector/src/test/resources/config/junit_config_1_springboot.properties @@ -53,6 +53,7 @@ eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.path= eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.password= eidas.ms.auth.eIDAS.zmrclient.req.organisation.behoerdennr=jUnit123456 +eidas.ms.auth.eIDAS.zmrclient.req.update.reason.code=EIDAS-KITT diff --git a/connector/src/test/resources/config/junit_config_2_springboot.properties b/connector/src/test/resources/config/junit_config_2_springboot.properties index 2300630f..a67e387f 100644 --- a/connector/src/test/resources/config/junit_config_2_springboot.properties +++ b/connector/src/test/resources/config/junit_config_2_springboot.properties @@ -53,7 +53,7 @@ eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.path= eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.password= eidas.ms.auth.eIDAS.zmrclient.req.organisation.behoerdennr=jUnit123456 - +eidas.ms.auth.eIDAS.zmrclient.req.update.reason.code=EIDAS-KITT ## PVP2 S-Profile end-point configuration -- cgit v1.2.3 From cbf1d0408519d0763a1a87b733c16a1ba5d022ba Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Wed, 7 Jul 2021 09:31:43 +0200 Subject: add HTML template for additional eID information --- .../config/StaticResourceConfiguration.java | 207 --------------------- .../controller/ProcessEngineSignalController.java | 3 +- .../resources/specific_eIDAS_connector.beans.xml | 3 - .../spring/SpringTest_connector.beans.xml | 2 +- 4 files changed, 3 insertions(+), 212 deletions(-) delete mode 100644 connector/src/main/java/at/asitplus/eidas/specific/connector/config/StaticResourceConfiguration.java (limited to 'connector') diff --git a/connector/src/main/java/at/asitplus/eidas/specific/connector/config/StaticResourceConfiguration.java b/connector/src/main/java/at/asitplus/eidas/specific/connector/config/StaticResourceConfiguration.java deleted file mode 100644 index a1e953f1..00000000 --- a/connector/src/main/java/at/asitplus/eidas/specific/connector/config/StaticResourceConfiguration.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright 2019 A-SIT Plus GmbH - * AT-specific eIDAS Connector has been developed in a cooperation between EGIZ, - * A-SIT Plus GmbH, A-SIT, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "License"); - * You may not use this work except in compliance with the License. - * You may obtain a copy of the License at: - * https://joinup.ec.europa.eu/news/understanding-eupl-v12 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - -package at.asitplus.eidas.specific.connector.config; - -import java.net.MalformedURLException; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.support.ReloadableResourceBundleMessageSource; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.thymeleaf.templateresolver.FileTemplateResolver; - -import at.asitplus.eidas.specific.connector.MsEidasNodeConstants; -import at.gv.egiz.eaaf.core.api.idp.IConfiguration; -import at.gv.egiz.eaaf.core.api.logging.IMessageSourceLocation; -import at.gv.egiz.eaaf.core.impl.utils.FileUtils; - -/** - * Spring configurator for Web resources. - * - * @author tlenz - * - */ -@Configuration -@EnableWebMvc -public class StaticResourceConfiguration implements WebMvcConfigurer { - private static final Logger log = LoggerFactory.getLogger(StaticResourceConfiguration.class); - private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { - "/" - }; - - private static final String DEFAULT_MESSAGE_SOURCE = "classpath:properties/status_messages"; - - @Autowired - private IConfiguration basicConfig; - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - final String staticResources = basicConfig.getBasicConfiguration( - MsEidasNodeConstants.PROP_CONFIG_WEBCONTENT_STATIC_PATH); - try { - if (StringUtils.isNotEmpty(staticResources)) { - String absPath = FileUtils.makeAbsoluteUrl(staticResources, basicConfig - .getConfigurationRootDirectory()); - if (!absPath.endsWith("/")) { - absPath += "/"; - } - - registry.addResourceHandler("/static/**").addResourceLocations(absPath); - log.info("Add Ressourcefolder: " + absPath + " for static Web content"); - - } else { - log.debug("No Ressourcefolder for static Web content"); - } - - } catch (final MalformedURLException e) { - log.warn("Can NOT initialize ressourcefolder for static Web content", e); - - } - - registry.addResourceHandler("/**").addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS); - - } - - /** - * Get a message source with only internal message properties. - * - * @param ressourceLocations List of source-locations - * @return - */ - @Bean - public ReloadableResourceBundleMessageSource internalMessageSource( - @Autowired(required = false) final List ressourceLocations) { - final ReloadableResourceBundleMessageSource messageSource = - new ReloadableResourceBundleMessageSource(); - - // add default message source - messageSource.setBasename(DEFAULT_MESSAGE_SOURCE); - - if (ressourceLocations != null) { - // load more message sources - for (final IMessageSourceLocation el : ressourceLocations) { - if (el.getMessageSourceLocation() != null) { - for (final String source : el.getMessageSourceLocation()) { - messageSource.addBasenames(source); - log.debug("Add additional messageSources: {}", el.getMessageSourceLocation().toArray()); - - } - } - } - } - - messageSource.setDefaultEncoding("UTF-8"); - return messageSource; - - } - - /** - * Get full message source with internal and external message-properties files. - * - * @param ressourceLocations List of source-locations - * @return - */ - @Bean - public ReloadableResourceBundleMessageSource messageSource( - @Autowired(required = false) final List ressourceLocations) { - final ReloadableResourceBundleMessageSource messageSource = - new ReloadableResourceBundleMessageSource(); - messageSource.setDefaultEncoding("UTF-8"); - messageSource.setParentMessageSource(internalMessageSource(ressourceLocations)); - - final String staticResources = basicConfig - .getBasicConfiguration(MsEidasNodeConstants.PROP_CONFIG_WEBCONTENT_PROPERTIES_PATH); - try { - if (StringUtils.isNotEmpty(staticResources)) { - final String absPath = - FileUtils.makeAbsoluteUrl(staticResources, basicConfig.getConfigurationRootDirectory()); - messageSource.setBasename(absPath); - - } else { - log.debug("No Ressourcefolder for dynamic Web content templates"); - - } - - } catch (final MalformedURLException e) { - log.warn("Can NOT initialize ressourcefolder for dynamic Web content templates", e); - - } - - return messageSource; - - } - - /** - * Get a Tyhmeleaf Template-Resolver with external configuration path. - * - * @return - */ - @Bean(name = "templateResolver") - public FileTemplateResolver templateResolver() { - final String staticResources = basicConfig - .getBasicConfiguration(MsEidasNodeConstants.PROP_CONFIG_WEBCONTENT_TEMPLATES_PATH); - try { - if (StringUtils.isNotEmpty(staticResources)) { - String absPath = - FileUtils.makeAbsoluteUrl(staticResources, basicConfig.getConfigurationRootDirectory()); - if (!absPath.endsWith("/")) { - absPath += "/"; - - } - - if (absPath.startsWith("file:")) { - absPath = absPath.substring("file:".length()); - - } - - final FileTemplateResolver viewResolver = new FileTemplateResolver(); - viewResolver.setPrefix(absPath); - viewResolver.setSuffix(".html"); - viewResolver.setTemplateMode("HTML"); - viewResolver.setCacheable(false); - - log.info("Add Ressourcefolder: {} for dynamic Web content templates", absPath); - return viewResolver; - - } else { - log.debug("No Ressourcefolder for dynamic Web content templates"); - - } - - } catch (final MalformedURLException e) { - log.warn("Can NOT initialize ressourcefolder for dynamic Web content templates", e); - - } - - throw new RuntimeException("Can NOT initialize HTML template resolver"); - - } -} diff --git a/connector/src/main/java/at/asitplus/eidas/specific/connector/controller/ProcessEngineSignalController.java b/connector/src/main/java/at/asitplus/eidas/specific/connector/controller/ProcessEngineSignalController.java index 1bf1ad67..6e2879a8 100644 --- a/connector/src/main/java/at/asitplus/eidas/specific/connector/controller/ProcessEngineSignalController.java +++ b/connector/src/main/java/at/asitplus/eidas/specific/connector/controller/ProcessEngineSignalController.java @@ -46,7 +46,8 @@ import at.gv.egiz.eaaf.core.impl.idp.controller.AbstractProcessEngineSignalContr public class ProcessEngineSignalController extends AbstractProcessEngineSignalController { @RequestMapping(value = { - MsEidasNodeConstants.ENDPOINT_COUNTRYSELECTION + MsEidasNodeConstants.ENDPOINT_COUNTRYSELECTION, + MsEidasNodeConstants.ENDPOINT_OTHER_LOGIN_METHOD_SELECTION }, method = { RequestMethod.POST, RequestMethod.GET }) public void performGenericAuthenticationProcess(HttpServletRequest req, HttpServletResponse resp) diff --git a/connector/src/main/resources/specific_eIDAS_connector.beans.xml b/connector/src/main/resources/specific_eIDAS_connector.beans.xml index 4608086e..ec16a7d2 100644 --- a/connector/src/main/resources/specific_eIDAS_connector.beans.xml +++ b/connector/src/main/resources/specific_eIDAS_connector.beans.xml @@ -13,9 +13,6 @@ - - diff --git a/connector/src/test/resources/spring/SpringTest_connector.beans.xml b/connector/src/test/resources/spring/SpringTest_connector.beans.xml index ac5455d3..81fff7dd 100644 --- a/connector/src/test/resources/spring/SpringTest_connector.beans.xml +++ b/connector/src/test/resources/spring/SpringTest_connector.beans.xml @@ -19,7 +19,7 @@ class="at.gv.egiz.eaaf.core.impl.idp.auth.services.DefaultErrorService"/> + class="at.asitplus.eidas.specific.connector.gui.config.StaticResourceConfiguration" /> -- cgit v1.2.3 From 802816a345059aa04c779cde246fd6cb2a2967fe Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Mon, 26 Jul 2021 10:33:21 +0200 Subject: update ZMR client WSDL to new version and refactor code to new API --- .../eidas/specific/connector/test/FullStartUpAndProcessTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'connector') diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java index 61312c3e..1690016e 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java @@ -57,7 +57,6 @@ import at.asitplus.eidas.specific.connector.controller.ProcessEngineSignalContro import at.asitplus.eidas.specific.connector.controller.Pvp2SProfileEndpoint; import at.asitplus.eidas.specific.connector.provider.PvpEndPointCredentialProvider; import at.asitplus.eidas.specific.connector.provider.PvpMetadataProvider; -import at.asitplus.eidas.specific.connector.provider.StatusMessageProvider; import at.asitplus.eidas.specific.connector.test.saml2.Pvp2SProfileEndPointTest; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.EidasSignalServlet; @@ -452,9 +451,9 @@ public class FullStartUpAndProcessTest { EidasIdentitaetErgebnisType eidasPersonalIdentifier = new EidasIdentitaetErgebnisType(); personInfo.getEidasIdentitaet().add(eidasPersonalIdentifier); - eidasPersonalIdentifier.setDokumentNummer(personalId); + eidasPersonalIdentifier.setEidasWert(personalId); eidasPersonalIdentifier.setEidasArt(Constants.eIDAS_ATTRURN_PERSONALIDENTIFIER); - eidasPersonalIdentifier.setStaatscode3(cc); + eidasPersonalIdentifier.setStaatscode2(cc); NatuerlichePersonErgebnisType natInfo = new NatuerlichePersonErgebnisType(); IdentificationType bpk = new IdentificationType(); -- cgit v1.2.3