From 8af25296dddd9cf3c43931f8cb4d552bb94ebf3d Mon Sep 17 00:00:00 2001
From: Thomas <>
Date: Thu, 10 Mar 2022 10:42:56 +0100
Subject: fix(matching): store pendingRequest and set relayState again in case
of ms-connector staging
---
.../modules/auth/eidas/v2/test/tasks/ReceiveAuthnResponseTaskTest.java | 3 +++
1 file changed, 3 insertions(+)
(limited to 'modules/authmodule-eIDAS-v2/src/test/java')
diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveAuthnResponseTaskTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveAuthnResponseTaskTest.java
index 87681435..a67b7f27 100644
--- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveAuthnResponseTaskTest.java
+++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveAuthnResponseTaskTest.java
@@ -156,6 +156,9 @@ public class ReceiveAuthnResponseTaskTest {
Assert.assertEquals("msConnectorStage", true,
(Boolean) executionContext.get(MsEidasNodeConstants.EXECCONTEXT_PARAM_MSCONNECTOR_STAGING));
+ IRequest storedReq = storage.getPendingRequest(pendingReq.getPendingRequestId());
+ Assert.assertNotNull("pendingReq not stored", storedReq);
+
//validate state
Assert.assertEquals("Wrong http statusCode", 302, httpResp.getStatus());
Assert.assertNotNull("No redirect header", httpResp.getHeaderValue("Location"));
--
cgit v1.2.3
From b5d1f18185a738eca10fd9d6298509dfa710d8ce Mon Sep 17 00:00:00 2001
From: Thomas <>
Date: Thu, 10 Mar 2022 11:13:24 +0100
Subject: fix(matching): remove staging infos to prohibit cycling forwarding
---
.../auth/eidas/v2/tasks/ReceiveAuthnResponseAlternativeTask.java | 3 +++
.../modules/auth/eidas/v2/test/tasks/ReceiveAuthnResponseTaskTest.java | 2 ++
2 files changed, 5 insertions(+)
(limited to 'modules/authmodule-eIDAS-v2/src/test/java')
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveAuthnResponseAlternativeTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveAuthnResponseAlternativeTask.java
index 690ce0bd..d2bd0128 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveAuthnResponseAlternativeTask.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveAuthnResponseAlternativeTask.java
@@ -171,6 +171,9 @@ public class ReceiveAuthnResponseAlternativeTask extends AbstractAuthServletTask
throws SpecificCommunicationException, IOException, EaafException {
executionContext.put(MsEidasNodeConstants.EXECCONTEXT_PARAM_MSCONNECTOR_STAGING, true);
+ //remove staging information because it's still in use
+ pendingReq.setRawDataToTransaction(MsEidasNodeConstants.EXECCONTEXT_PARAM_MSCONNECTOR_STAGING, null);
+
final SpecificCommunicationService specificConnectorCommunicationService =
(SpecificCommunicationService) context.getBean(
SpecificCommunicationDefinitionBeanNames.SPECIFIC_CONNECTOR_COMMUNICATION_SERVICE.toString());
diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveAuthnResponseTaskTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveAuthnResponseTaskTest.java
index a67b7f27..842c8bf7 100644
--- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveAuthnResponseTaskTest.java
+++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveAuthnResponseTaskTest.java
@@ -158,6 +158,8 @@ public class ReceiveAuthnResponseTaskTest {
IRequest storedReq = storage.getPendingRequest(pendingReq.getPendingRequestId());
Assert.assertNotNull("pendingReq not stored", storedReq);
+ Assert.assertNull("staging info is not null", storedReq.getRawData(
+ MsEidasNodeConstants.EXECCONTEXT_PARAM_MSCONNECTOR_STAGING, String.class));
//validate state
Assert.assertEquals("Wrong http statusCode", 302, httpResp.getStatus());
--
cgit v1.2.3
From 9a9c5e8696b4bcff1c4511b5edbc44ca0e48799a Mon Sep 17 00:00:00 2001
From: Thomas <>
Date: Thu, 10 Mar 2022 12:23:42 +0100
Subject: test(matching): add a few more E2E tests
---
.../test/clients/ErnpRestClientProductionTest.java | 25 ++++++++++++++++++++++
.../v2/test/clients/SzrClientProductionTest.java | 24 +++++++++++++++++++++
2 files changed, 49 insertions(+)
(limited to 'modules/authmodule-eIDAS-v2/src/test/java')
diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ErnpRestClientProductionTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ErnpRestClientProductionTest.java
index 66a426a1..fc0f7698 100644
--- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ErnpRestClientProductionTest.java
+++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ErnpRestClientProductionTest.java
@@ -411,6 +411,31 @@ public class ErnpRestClientProductionTest {
}
+ @Ignore
+ @Test
+ @SneakyThrows
+ public void addErnpEntryE2ETest() {
+ final String personalIdentifierFirst = "adfasfsadvsafsafweqrwr432553324";
+ final String cc = "EE";
+ final SimpleEidasData eidasDataFirst = SimpleEidasData.builder()
+ .citizenCountryCode(cc)
+ .familyName("Mustermatch01")
+ .givenName("Max")
+ .dateOfBirth("1965-01-01")
+ .personalIdentifier(cc + "/AT/" + personalIdentifierFirst)
+ .pseudonym(personalIdentifierFirst)
+ .build();
+
+ // execute operation
+ ErnpRegisterResult resp = client.add(eidasDataFirst);
+
+ // validate state
+ assertNotNull("no ERnP response", resp);
+ assertEquals("wrong resp size", 1, resp.getPersonResult().size());
+ checkErnpResult(resp.getPersonResult().get(0), eidasDataFirst, 1);
+
+ }
+
@Test
@SneakyThrows
public void addRandomErnpEntry() {
diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/SzrClientProductionTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/SzrClientProductionTest.java
index fb52a729..d2bfe662 100644
--- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/SzrClientProductionTest.java
+++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/SzrClientProductionTest.java
@@ -23,6 +23,8 @@
package at.asitplus.eidas.specific.modules.auth.eidas.v2.test.clients;
+import static org.junit.Assert.assertNotNull;
+
import java.util.List;
import org.apache.commons.lang3.RandomStringUtils;
@@ -42,6 +44,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.clients.szr.SzrClient;
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.MatchedPersonResult;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.EidasSAuthenticationException;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.SzrCommunicationException;
@@ -73,6 +76,27 @@ public class SzrClientProductionTest {
}
+
+ @Ignore
+ @Test
+ public void getEncBaseId() throws SzrCommunicationException {
+
+ MatchedPersonResult matchingResult = MatchedPersonResult.builder()
+ .bpk("QusNG6WEct/vkD1aoRfxHod0Dtk=")
+ .familyName("Garcia")
+ .givenName("javier")
+ .dateOfBirth("1964-12-31")
+ .build();
+
+
+ String baseId = szrClient.getEncryptedStammzahl(matchingResult);
+
+
+ assertNotNull("not encrypted baseId", baseId);
+
+ }
+
+
@Test
public void getEidasBind() throws EidasSAuthenticationException {
String vsz = RandomStringUtils.randomAlphanumeric(10);
--
cgit v1.2.3
From ad7891d0c51adac7498f85558652c6fdf613ccce Mon Sep 17 00:00:00 2001
From: Thomas <>
Date: Thu, 10 Mar 2022 13:53:12 +0100
Subject: fix(matching): unset flag from ExecutionContext that raise into a
loop
---
.../eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java | 3 ++-
.../test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java | 10 ++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
(limited to 'modules/authmodule-eIDAS-v2/src/test/java')
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java
index c9f043b5..8611be81 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java
@@ -65,9 +65,10 @@ public class ReceiveOtherLoginMethodGuiResponseTask extends AbstractLocaleAuthSe
HttpServletResponse response) {
try {
SelectedLoginMethod selection = SelectedLoginMethod.valueOf(extractUserSelection(request));
+ executionContext.put(Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK, false);
executionContext.put(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER, selection);
executionContext.remove(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED);
- executionContext.remove(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED_REASON);
+ executionContext.remove(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED_REASON);
transitionToNextTask(executionContext, selection);
} catch (final Exception e) {
diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java
index da8a7497..6ec7d6e0 100644
--- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java
+++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java
@@ -4,8 +4,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThrows;
-import static org.springframework.util.Assert.isInstanceOf;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Before;
@@ -76,21 +74,29 @@ public class ReceiveOtherLoginMethodGuiResponseTaskTest {
@Test
public void withMobileSignatureSelection() throws TaskExecutionException {
testTransition(SelectedLoginMethod.MOBILE_PHONE_SIGNATURE_LOGIN, Constants.TRANSITION_TO_GENERATE_MOBILE_PHONE_SIGNATURE_REQUEST_TASK);
+ assertEquals("return to selection", false, executionContext.get(Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK));
+
}
@Test
public void withEidasSelection() throws TaskExecutionException {
testTransition(SelectedLoginMethod.EIDAS_LOGIN, Constants.TRANSITION_TO_GENERATE_EIDAS_LOGIN);
+ assertEquals("return to selection", false, executionContext.get(Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK));
+
}
@Test
public void withNoOtherLoginSelection() throws TaskExecutionException {
testTransition(SelectedLoginMethod.NO_OTHER_LOGIN, Constants.TRANSITION_TO_GENERATE_GUI_QUERY_AUSTRIAN_RESIDENCE_TASK);
+ assertEquals("return to selection", false, executionContext.get(Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK));
+
}
@Test
public void withAddMeAsNewSelection() throws TaskExecutionException {
testTransition(SelectedLoginMethod.ADD_ME_AS_NEW, Constants.TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_TASK);
+ assertEquals("return to selection", false, executionContext.get(Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK));
+
}
public void testTransition(SelectedLoginMethod loginMethod, String expectedTransition) throws TaskExecutionException {
--
cgit v1.2.3
From 51984cd48762b50cf64fc8f6aa54be1a8e7bf31a Mon Sep 17 00:00:00 2001
From: Thomas <>
Date: Thu, 10 Mar 2022 15:32:01 +0100
Subject: chore(matching): inject REST endpoint for address wizard by GUI model
---
basicConfig/templates/residency.html | 2 +-
.../v2/tasks/GenerateAustrianResidenceGuiTask.java | 2 +-
.../GenerateAustrianResidenceGuiTaskTest.java | 119 +++++++++++++++++++++
.../tasks/GenerateOtherLoginMethodGuiTaskTest.java | 3 -
4 files changed, 121 insertions(+), 5 deletions(-)
create mode 100644 modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAustrianResidenceGuiTaskTest.java
(limited to 'modules/authmodule-eIDAS-v2/src/test/java')
diff --git a/basicConfig/templates/residency.html b/basicConfig/templates/residency.html
index d89b909c..c94721c0 100644
--- a/basicConfig/templates/residency.html
+++ b/basicConfig/templates/residency.html
@@ -43,7 +43,7 @@
}
$.ajax({
type: "POST",
- url: "$contextPath$wizardEndpoint",
+ url: [(${wizardEndpoint})],
data: $("#inputForm").serialize()
}).done(function (data, textStatus, jqXHR) {
if (data["resultCount"] === 1) {
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateAustrianResidenceGuiTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateAustrianResidenceGuiTask.java
index 120c3189..060f9624 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateAustrianResidenceGuiTask.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateAustrianResidenceGuiTask.java
@@ -70,7 +70,7 @@ public class GenerateAustrianResidenceGuiTask extends AbstractAuthServletTask {
// inject REST end-point for wizard
config.putCustomParameterWithOutEscaption(null,
PARAM_FORMWIZARDPOINT,
- MsEidasNodeConstants.ENDPOINT_RESIDENCY_SEARCH);
+ pendingReq.getAuthUrl() + MsEidasNodeConstants.ENDPOINT_RESIDENCY_SEARCH);
guiBuilder.build(request, response, config, "Query Austrian residency");
diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAustrianResidenceGuiTaskTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAustrianResidenceGuiTaskTest.java
new file mode 100644
index 00000000..539a41d2
--- /dev/null
+++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAustrianResidenceGuiTaskTest.java
@@ -0,0 +1,119 @@
+package at.asitplus.eidas.specific.modules.auth.eidas.v2.test.tasks;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.UnsupportedEncodingException;
+import java.util.Locale;
+
+import org.apache.commons.lang3.RandomStringUtils;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.i18n.LocaleContextHolder;
+import org.springframework.mock.web.MockHttpServletRequest;
+import org.springframework.mock.web.MockHttpServletResponse;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.web.WebAppConfiguration;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.json.JsonMapper;
+
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.GenerateAustrianResidenceGuiTask;
+import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException;
+import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl;
+import at.gv.egiz.eaaf.core.impl.idp.process.ExecutionContextImpl;
+import lombok.SneakyThrows;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(locations = {
+ "/SpringTest-context_tasks_test.xml",
+ "/SpringTest-context_basic_mapConfig.xml",
+ "/common_gui.beans.xml"
+})
+@WebAppConfiguration
+public class GenerateAustrianResidenceGuiTaskTest {
+
+
+ @Autowired
+ GenerateAustrianResidenceGuiTask task;
+
+ private ExecutionContextImpl executionContext = new ExecutionContextImpl();
+ private TestRequestImpl pendingReq;
+ private MockHttpServletRequest httpReq;
+ private MockHttpServletResponse httpResp;
+
+ @BeforeClass
+ public static void classInitializer() {
+ Locale.setDefault(Locale.ENGLISH);
+
+ }
+
+ /**
+ * jUnit test set-up.
+ */
+ @Before
+ public void initialize() {
+ httpReq = new MockHttpServletRequest("POST", "https://localhost/ms_connector");
+ httpResp = new MockHttpServletResponse();
+ RequestContextHolder.resetRequestAttributes();
+ RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(httpReq, httpResp));
+
+ pendingReq = new TestRequestImpl();
+ pendingReq.setAuthUrl("https://localhost/ms_connector");
+ pendingReq.setPendingReqId(RandomStringUtils.randomAlphanumeric(10));
+
+ LocaleContextHolder.resetLocaleContext();
+
+ }
+
+ @Test
+ @SneakyThrows
+ public void jsonResponse() throws TaskExecutionException, UnsupportedEncodingException {
+ httpReq.addHeader("Accept", "application/json");
+
+ task.execute(pendingReq, executionContext);
+
+ //result validation
+ Assert.assertEquals("httpStausCode", 200, httpResp.getStatus());
+ Assert.assertEquals("http ContentType", "application/json;charset=UTF-8", httpResp.getContentType());
+ final String content = httpResp.getContentAsString();
+ assertNotNull("response body is null", content);
+ Assert.assertFalse("response body is empty", content.isEmpty());
+ final JsonNode json = new JsonMapper().readTree(content);
+ assertNotNull("response body is null", json);
+ checkJsonElement(json, "wizardEndpoint", "https://localhost/ms_connector/residency/search");
+
+ }
+
+ @Test
+ @SneakyThrows
+ public void htmlResponse() throws TaskExecutionException, UnsupportedEncodingException {
+
+ task.execute(pendingReq, executionContext);
+
+ //result validation
+ Assert.assertEquals("httpStausCode", 200, httpResp.getStatus());
+ Assert.assertEquals("http ContentType", "text/html;charset=UTF-8", httpResp.getContentType());
+ final String content = httpResp.getContentAsString();
+ assertNotNull("response body is null", content);
+ Assert.assertFalse("response body is empty", content.isEmpty());
+ assertTrue("no wizard endpoint", content.contains("https://localhost/ms_connector/residency/search"));
+
+ }
+
+ private void checkJsonElement(JsonNode json, String key, String expected) {
+ assertTrue("no element: " + key, json.has(key));
+ assertEquals("wrong element:" + key, expected, json.get(key).asText());
+
+ }
+
+
+}
diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java
index ff994061..68b73734 100644
--- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java
+++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java
@@ -25,7 +25,6 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants;
@@ -48,8 +47,6 @@ public class GenerateOtherLoginMethodGuiTaskTest {
private static final String TEST_PATTER_REQ_PARAM =
"";
- private static ObjectMapper mapper = new ObjectMapper();
-
@Autowired
GenerateOtherLoginMethodGuiTask task;
--
cgit v1.2.3
From 64a7785ffafc39b99d4a5f88adde86effdfb83bc Mon Sep 17 00:00:00 2001
From: Thomas <>
Date: Thu, 10 Mar 2022 16:22:45 +0100
Subject: fix(matching): remove requested LoA level from matching by
alternative IDA login
---
.../eidas/v2/tasks/GenerateMobilePhoneSignatureRequestTask.java | 4 +---
.../test/tasks/GenerateMobilePhoneSignatureRequestTaskTest.java | 8 ++------
2 files changed, 3 insertions(+), 9 deletions(-)
(limited to 'modules/authmodule-eIDAS-v2/src/test/java')
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateMobilePhoneSignatureRequestTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateMobilePhoneSignatureRequestTask.java
index 715d3672..26282d5c 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateMobilePhoneSignatureRequestTask.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateMobilePhoneSignatureRequestTask.java
@@ -139,9 +139,7 @@ public class GenerateMobilePhoneSignatureRequestTask extends AbstractAuthServlet
authnReqConfig.setSignCred(credential.getMessageSigningCredential());
authnReqConfig.setSpEntityID(
pendingReq.getAuthUrlWithOutSlash() + IdAustriaClientAuthConstants.ENDPOINT_METADATA);
- authnReqConfig.setRequestedLoA(authConfig.getBasicConfiguration(
- IdAustriaClientAuthConstants.CONFIG_PROPS_REQUIRED_LOA,
- IdAustriaClientAuthConstants.CONFIG_DEFAULT_LOA_EIDAS_LEVEL));
return authnReqConfig;
+
}
}
diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateMobilePhoneSignatureRequestTaskTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateMobilePhoneSignatureRequestTaskTest.java
index e82d4122..ffa02ccd 100644
--- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateMobilePhoneSignatureRequestTaskTest.java
+++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateMobilePhoneSignatureRequestTaskTest.java
@@ -2,6 +2,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.test.tasks;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.springframework.util.Assert.isInstanceOf;
@@ -236,12 +237,7 @@ public class GenerateMobilePhoneSignatureRequestTaskTest {
metadataFactory.createMetadataProvider(METADATA_SP_PATH, null, "jUnit SP", null));
samlVerifyEngine.verify(msg, TrustEngineFactory.getSignatureKnownKeysTrustEngine(metadataProvider));
- assertNotNull("RequestedAuthnContext", authnRequest.getRequestedAuthnContext());
- assertNotNull("AuthnContextClassRef", authnRequest.getRequestedAuthnContext().getAuthnContextClassRefs());
- assertEquals("#AuthnContextClassRef", 1,
- authnRequest.getRequestedAuthnContext().getAuthnContextClassRefs().size());
- assertEquals("LoA", "http://eidas.europa.eu/LoA/high",
- authnRequest.getRequestedAuthnContext().getAuthnContextClassRefs().get(0).getAuthnContextClassRef());
+ assertNull("RequestedAuthnContext", authnRequest.getRequestedAuthnContext());
}
--
cgit v1.2.3
From 34dff8116290845953e386c6bfd7d17224a6ad34 Mon Sep 17 00:00:00 2001
From: Thomas <>
Date: Thu, 10 Mar 2022 16:49:48 +0100
Subject: chore(matching): remove some PVP attributes from IDA authentication
---
.../auth/eidas/v2/idaustriaclient/IdAustriaClientAuthConstants.java | 4 ----
.../auth/eidas/v2/tasks/ReceiveMobilePhoneSignatureResponseTask.java | 2 ++
.../idaustriaclient/IdAustriaClientAuthMetadataControllerTest.java | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
(limited to 'modules/authmodule-eIDAS-v2/src/test/java')
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/idaustriaclient/IdAustriaClientAuthConstants.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/idaustriaclient/IdAustriaClientAuthConstants.java
index 46d0e77d..67dfd7d8 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/idaustriaclient/IdAustriaClientAuthConstants.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/idaustriaclient/IdAustriaClientAuthConstants.java
@@ -69,10 +69,6 @@ public class IdAustriaClientAuthConstants {
private static final long serialVersionUID = 1L;
{
- // add PVP Version attribute
- add(Triple.newInstance(PvpAttributeDefinitions.PVP_VERSION_NAME,
- PvpAttributeDefinitions.PVP_VERSION_FRIENDLY_NAME, true));
-
// entity metadata information
add(Triple.newInstance(PvpAttributeDefinitions.EID_CITIZEN_EIDAS_QAA_LEVEL_NAME,
PvpAttributeDefinitions.EID_CITIZEN_EIDAS_QAA_LEVEL_FRIENDLY_NAME, true));
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveMobilePhoneSignatureResponseTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveMobilePhoneSignatureResponseTask.java
index 514e38ba..286b63b1 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveMobilePhoneSignatureResponseTask.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveMobilePhoneSignatureResponseTask.java
@@ -308,6 +308,7 @@ public class ReceiveMobilePhoneSignatureResponseTask extends AbstractAuthServlet
IdAustriaClientAuthEventConstants.AUTHPROCESS_ID_AUSTRIA_RESPONSE_RECEIVED,
response.getID());
return Pair.newInstance(msg, false);
+
} else {
log.info("Receive StatusCode {} from 'ms-specific eIDAS node'.", response.getStatus().getStatusCode().getValue());
StatusCode subStatusCode = getSubStatusCode(response);
@@ -315,6 +316,7 @@ public class ReceiveMobilePhoneSignatureResponseTask extends AbstractAuthServlet
&& IdAustriaClientAuthConstants.SAML2_STATUSCODE_USERSTOP.equals(subStatusCode.getValue())) {
log.info("Find 'User-Stop operation' in SAML2 response. Stopping authentication process ... ");
return Pair.newInstance(msg, true);
+
}
revisionsLogger.logEvent(pendingReq,
diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/idaustriaclient/IdAustriaClientAuthMetadataControllerTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/idaustriaclient/IdAustriaClientAuthMetadataControllerTest.java
index 095a020a..b7f27204 100644
--- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/idaustriaclient/IdAustriaClientAuthMetadataControllerTest.java
+++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/idaustriaclient/IdAustriaClientAuthMetadataControllerTest.java
@@ -79,7 +79,7 @@ public class IdAustriaClientAuthMetadataControllerTest {
controller.getSpMetadata(httpReq, httpResp);
//check result
- validateResponse(7);
+ validateResponse(6);
}
--
cgit v1.2.3
From 08ee18252a84f29913256cfabae835010442586c Mon Sep 17 00:00:00 2001
From: Thomas <>
Date: Thu, 10 Mar 2022 16:57:55 +0100
Subject: refactor(matching): set other matching option as String to prohibit
staging problems
---
.../auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java | 2 +-
.../eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
(limited to 'modules/authmodule-eIDAS-v2/src/test/java')
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java
index 8611be81..075b23c1 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java
@@ -66,7 +66,7 @@ public class ReceiveOtherLoginMethodGuiResponseTask extends AbstractLocaleAuthSe
try {
SelectedLoginMethod selection = SelectedLoginMethod.valueOf(extractUserSelection(request));
executionContext.put(Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK, false);
- executionContext.put(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER, selection);
+ executionContext.put(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER, selection.name());
executionContext.remove(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED);
executionContext.remove(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED_REASON);
transitionToNextTask(executionContext, selection);
diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java
index 6ec7d6e0..750a17ce 100644
--- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java
+++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java
@@ -108,7 +108,7 @@ public class ReceiveOtherLoginMethodGuiResponseTaskTest {
assertFalse("wrong pendingReq auth flag", pendingReq.isAuthenticated());
assertFalse("wrong process-cancelled flag", executionContext.isProcessCancelled());
assertNotNull("no login-selection found", executionContext.get(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER));
- assertEquals("Wrong login-selection found", loginMethod, executionContext.get(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER));
+ assertEquals("Wrong login-selection found", loginMethod.name(), executionContext.get(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER));
assertEquals("Next task", true, executionContext.get(expectedTransition));
assertNull("find advancedMatchingError flag", executionContext.get(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED));
--
cgit v1.2.3
From f2df62788d1c47aea5dc16d985fd8b4fd9fa424c Mon Sep 17 00:00:00 2001
From: Thomas <>
Date: Thu, 10 Mar 2022 18:04:20 +0100
Subject: fix(matching): store pendingRequest before next asynch. step
---
.../auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java | 3 +++
.../eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java | 8 ++++++++
2 files changed, 11 insertions(+)
(limited to 'modules/authmodule-eIDAS-v2/src/test/java')
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java
index 361f049b..62e5c57b 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java
@@ -88,6 +88,9 @@ public class GenerateOtherLoginMethodGuiTask extends AbstractAuthServletTask {
}
+ // store pending request before next step
+ requestStoreage.storePendingRequest(pendingReq);
+
guiBuilder.build(request, response, config, "Other login methods selection form");
} catch (final Exception e) {
diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java
index 68b73734..cc092004 100644
--- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java
+++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java
@@ -30,6 +30,8 @@ import com.fasterxml.jackson.databind.json.JsonMapper;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SelectedLoginMethod;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.GenerateOtherLoginMethodGuiTask;
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.test.dummy.DummyOA;
+import at.gv.egiz.eaaf.core.api.IRequestStorage;
import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException;
import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl;
import at.gv.egiz.eaaf.core.impl.idp.process.ExecutionContextImpl;
@@ -49,6 +51,8 @@ public class GenerateOtherLoginMethodGuiTaskTest {
@Autowired
GenerateOtherLoginMethodGuiTask task;
+
+ @Autowired IRequestStorage storage;
private ExecutionContextImpl executionContext = new ExecutionContextImpl();
private TestRequestImpl pendingReq;
@@ -74,6 +78,7 @@ public class GenerateOtherLoginMethodGuiTaskTest {
pendingReq = new TestRequestImpl();
pendingReq.setAuthUrl("https://localhost/ms_connector");
pendingReq.setPendingReqId(RandomStringUtils.randomAlphanumeric(10));
+ pendingReq.setSpConfig(new DummyOA());
LocaleContextHolder.resetLocaleContext();
}
@@ -103,6 +108,9 @@ public class GenerateOtherLoginMethodGuiTaskTest {
assertEquals("advancedMatchingFailedReason", reason,
json.get(Constants.HTML_FORM_ADVANCED_MATCHING_FAILED_REASON).asText());
+ assertNotNull("pendingRequest not stored",
+ storage.getPendingRequest(pendingReq.getPendingRequestId()));
+
}
@Test
--
cgit v1.2.3
From 2119f7613a04651d7cc1cb9a8c7ecdc8556d07d9 Mon Sep 17 00:00:00 2001
From: Thomas <>
Date: Fri, 11 Mar 2022 07:09:27 +0100
Subject: fix(matching): unset all matching releated parameters on
executioncontext
---
.../v2/tasks/GenerateOtherLoginMethodGuiTask.java | 7 +++--
.../ReceiveOtherLoginMethodGuiResponseTask.java | 11 ++++++++
.../tasks/GenerateOtherLoginMethodGuiTaskTest.java | 32 +++++++++++++++++++++-
3 files changed, 47 insertions(+), 3 deletions(-)
(limited to 'modules/authmodule-eIDAS-v2/src/test/java')
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java
index 62e5c57b..f6ca0309 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java
@@ -84,10 +84,13 @@ public class GenerateOtherLoginMethodGuiTask extends AbstractAuthServletTask {
config.putCustomParameter(AbstractGuiFormBuilderConfiguration.PARAM_GROUP_UIOPTIONS,
Constants.HTML_FORM_ADVANCED_MATCHING_FAILED_REASON,
executionContext.get(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED_REASON).toString());
- }
-
+ }
}
+ // reset executionContext parameters
+ ReceiveOtherLoginMethodGuiResponseTask.ALL_EXECUTIONCONTEXT_PARAMETERS.forEach(
+ el -> executionContext.remove(el));
+
// store pending request before next step
requestStoreage.storePendingRequest(pendingReq);
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java
index 075b23c1..184ad499 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java
@@ -24,6 +24,7 @@
package at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks;
import java.util.Enumeration;
+import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -31,6 +32,8 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringEscapeUtils;
import org.springframework.stereotype.Component;
+import com.google.common.collect.Sets;
+
import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SelectedLoginMethod;
import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext;
@@ -60,6 +63,14 @@ import lombok.extern.slf4j.Slf4j;
@Component("ReceiveOtherLoginMethodGuiResponseTask")
public class ReceiveOtherLoginMethodGuiResponseTask extends AbstractLocaleAuthServletTask {
+ public static final Set ALL_EXECUTIONCONTEXT_PARAMETERS = Sets.newHashSet(
+ Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER,
+ Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK,
+ Constants.TRANSITION_TO_GENERATE_EIDAS_LOGIN,
+ Constants.TRANSITION_TO_GENERATE_MOBILE_PHONE_SIGNATURE_REQUEST_TASK,
+ Constants.TRANSITION_TO_GENERATE_GUI_QUERY_AUSTRIAN_RESIDENCE_TASK,
+ Constants.TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_TASK);
+
@Override
public void executeWithLocale(ExecutionContext executionContext, HttpServletRequest request,
HttpServletResponse response) {
diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java
index cc092004..1751e95a 100644
--- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java
+++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java
@@ -2,6 +2,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.test.tasks;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.io.UnsupportedEncodingException;
@@ -30,8 +31,10 @@ import com.fasterxml.jackson.databind.json.JsonMapper;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SelectedLoginMethod;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.GenerateOtherLoginMethodGuiTask;
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.ReceiveOtherLoginMethodGuiResponseTask;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.test.dummy.DummyOA;
import at.gv.egiz.eaaf.core.api.IRequestStorage;
+import at.gv.egiz.eaaf.core.api.data.EaafConstants;
import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException;
import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl;
import at.gv.egiz.eaaf.core.impl.idp.process.ExecutionContextImpl;
@@ -54,7 +57,7 @@ public class GenerateOtherLoginMethodGuiTaskTest {
@Autowired IRequestStorage storage;
- private ExecutionContextImpl executionContext = new ExecutionContextImpl();
+ private ExecutionContextImpl executionContext;
private TestRequestImpl pendingReq;
private MockHttpServletRequest httpReq;
private MockHttpServletResponse httpResp;
@@ -80,10 +83,37 @@ public class GenerateOtherLoginMethodGuiTaskTest {
pendingReq.setPendingReqId(RandomStringUtils.randomAlphanumeric(10));
pendingReq.setSpConfig(new DummyOA());
+ executionContext = new ExecutionContextImpl();
+
LocaleContextHolder.resetLocaleContext();
}
+ @Test
+ @SneakyThrows
+ public void unsetExecutionContextParameters() throws TaskExecutionException, UnsupportedEncodingException {
+ httpReq.addHeader("Accept", "application/json");
+ ReceiveOtherLoginMethodGuiResponseTask.ALL_EXECUTIONCONTEXT_PARAMETERS.forEach(
+ el -> executionContext.put(el, RandomStringUtils.randomAlphabetic(5)));
+
+ // execute test
+ task.execute(pendingReq, executionContext);
+
+ //result validation
+ Assert.assertEquals("httpStausCode", 200, httpResp.getStatus());
+ Assert.assertEquals("http ContentType", "application/json;charset=UTF-8", httpResp.getContentType());
+
+ ReceiveOtherLoginMethodGuiResponseTask.ALL_EXECUTIONCONTEXT_PARAMETERS.forEach(
+ el -> assertNull("executionContext parameter: " + el, executionContext.get(el)));
+
+ // remove pendingRequestId because it's added by default
+ executionContext.remove(EaafConstants.PROCESS_ENGINE_PENDINGREQUESTID);
+
+ // in case of 'ReceiveOtherLoginMethodGuiResponseTask.ALL_EXECUTIONCONTEXT_PARAMETERS' does not include all parameters
+ assertTrue("ExecutionContext is not empty", executionContext.keySet().isEmpty());
+
+ }
+
@Test
@SneakyThrows
public void jsonResponse() throws TaskExecutionException, UnsupportedEncodingException {
--
cgit v1.2.3
From 69aa81016fe20e901a3be02bb6772c9185c0b9ef Mon Sep 17 00:00:00 2001
From: Thomas <>
Date: Mon, 2 May 2022 17:16:15 +0200
Subject: chore(matching): re-oreder process steps in GUI releated matching
---
basicConfig/properties/messages.properties | 29 +++--
basicConfig/properties/messages_de.properties | 32 ++++--
basicConfig/templates/language_selection.html | 12 +--
basicConfig/templates/other_login_method.html | 120 +++++++++++++--------
basicConfig/templates/residency.html | 27 ++++-
basicConfig/webcontent/css/css_country.css | 18 ++++
.../tasks/GenerateCountrySelectionFrameTask.java | 3 +-
.../specific/modules/auth/eidas/v2/Constants.java | 7 ++
.../v2/tasks/GenerateAustrianResidenceGuiTask.java | 26 ++++-
.../v2/tasks/GenerateOtherLoginMethodGuiTask.java | 24 ++---
.../ReceiveAustrianResidenceGuiResponseTask.java | 33 ++++--
.../auth/eidas/v2/utils/MatchingTaskUtils.java | 19 +++-
.../resources/eIDAS.Authentication.process.xml | 6 +-
.../messages/eidas_connector_message.properties | 3 +-
.../GenerateAustrianResidenceGuiTaskTest.java | 53 +++++++++
.../tasks/GenerateOtherLoginMethodGuiTaskTest.java | 67 ++++++++++--
...strianResidenceGuiResponseTaskRegisterTest.java | 14 +--
...eceiveAustrianResidenceGuiResponseTaskTest.java | 20 ++--
18 files changed, 388 insertions(+), 125 deletions(-)
(limited to 'modules/authmodule-eIDAS-v2/src/test/java')
diff --git a/basicConfig/properties/messages.properties b/basicConfig/properties/messages.properties
index f768c00e..e1a87298 100644
--- a/basicConfig/properties/messages.properties
+++ b/basicConfig/properties/messages.properties
@@ -19,6 +19,7 @@ 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.cancel=Cancel
+gui.countryselection.cancle=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
@@ -120,7 +121,13 @@ gui.countryselection.mode.dev=Development
##Other Login Methods page
gui.otherlogin.title=eIDAS-Login Other Login Methods
-gui.otherlogin.header.selection=Select an alternative login method
+gui.otherlogin.header.selection=Person information not found
+
+gui.otherlogin.info.first=Ihre Personendaten aus dem eben erfolgten EU-Login konnten in den Registern der österreichischen Verwaltung keinem Registereintrag eindeutig zugeordnet werden. Das kann daran liegen, dass Sie in den Registern bisher nicht eingetragen sind, oder ihre aktuellen Anmeldedaten nicht vollständig mit den in den Registern hinterlegten Daten zu Ihrer Person übereinstimmen.
+gui.otherlogin.info.second=Sie haben folgende Möglichkeiten, um eine korrekte Zuordnung zu erreichen:
+gui.otherlogin.info.list.1=Wenn Sie über eine österreichische Handy-Signatur (oder ID Austria) oder über eine alternative Möglichkeit eines EU-Logins verfügen, melden Sie sich mit diesen bitte erneut an. Verwenden Sie dazu bitte die entsprechende Schaltfläche „ID Austria“ oder „Alternative eIDAS ID“.
+gui.otherlogin.info.list.2=Verfügen Sie über keine der beiden oben genannten zusätzlichen Anmeldemöglichkeiten, setzen Sie bitte über die Schaltfläche „No alternative login methods“ fort
+
gui.otherlogin.button.hs=ID Austria
gui.otherlogin.button.eidas=Alternative eIDAS ID
gui.otherlogin.button.none=No alternative login methods
@@ -129,13 +136,12 @@ gui.otherlogin.cancel=Cancel
gui.otherlogin.inserternp.infotext=You can create a new Austrian Identity by using your identity information provided by eIDAS. During these, you get a new Austrian identifier.
-module.eidasauth.matching.20=Matching be using residence information was canceled. Use another method for matching or create a new Austrian identity.
-module.eidasauth.matching.21=Matching be using residence information failed by missing input information. Use another method for matching or create a new Austrian identity.
-module.eidasauth.matching.22=Can not find an unique match by using residence information. Provide more or other data, use another method for matching, or create a new Austrian identity.
-module.eidasauth.matching.23=Matching be using ID Austria was canceled. Use another method for matching or create a new Austrian identity.
-module.eidasauth.matching.24=Matching be using ID Austria not possible. Use another method for matching or create a new Austrian identity.
-module.eidasauth.matching.25=Matching be using alternative eIDAS authentication not possible. Provide more or other data, use another method for matching, or create a new Austrian identity.
-module.eidasauth.matching.29=Matching be using other information failed. Provide more or other data, use another method for matching, or create a new Austrian identity.
+module.eidasauth.matching.21=Matching be using residence information failed by missing input information. Add all required information.
+module.eidasauth.matching.22=Can not find an unique match by using residence information. Provide more or other data, use another method for matching.
+module.eidasauth.matching.23=Matching be using ID Austria was canceled. Use another method for matching.
+module.eidasauth.matching.24=Matching be using ID Austria not possible. Use another method for matching.
+module.eidasauth.matching.25=Matching be using alternative eIDAS authentication not possible. Provide more or other data, or use another method for matching.
+module.eidasauth.matching.29=Matching be using other information failed. Provide more or other data, or use another method for matching.
##Austrian Residency page
@@ -143,9 +149,14 @@ gui.residency.title=Austrian Residency
gui.residency.header.selection=Search for your Austrian Residency
gui.residency.header.help=You can search for the address that you have been registered at in the past. Please enter a \
postcode, municipality or village first to start the search.
+
+gui.residency.info.first=Haben Sie einen aktuellen oder ehemaligen gemeldeten Wohnsitz in Österreich, kann eine Zuordnung zu Ihrem bestehenden Registereintrag über Eingabe der Wohnsitzdaten erfolgen. Bitte benutzen Sie das untenstehende Formular, um Ihre Wohnsitzdaten einzugeben.
+gui.residency.info.second=Bitte geben Sie dazu zuerst eine Postleitzahl, Gemeinde oder Ortschaft ein und starten Sie die Suche Ihrer Wohnsitzadresse dann über die Schaltfläche „Search“. Sie werden in weiterer Folge bei der Vervollständigung der Wohnsitzadresse interaktiv unterstützt. Folgen Sie dazu den Anweisungen im Formular. Über die Schaltfläche „Clear“ können Sie den Suchvorgang jederzeit neu starten. Wurden alle Wohnsitzdaten über die Suchfunktion vollständig befüllt, setzen Sie bitte über die Schaltfläche „Proceed“ fort.
+gui.residency.info.third=Haben sie keinen aktuellen oder ehemaligen Wohnsitz in Österreich, setzen Sie bitte über die Schaltfläche „No Austrian Residency“ fort.
+
gui.residency.header.inputinvalid=Be sure to enter a value for Municipality or Village
gui.residency.cancel=Cancel
-gui.residency.back=Back to previous step
+gui.residency.back=No Austrian Residency
gui.residency.search=Search
gui.residency.clear=Clear
gui.residency.proceed=Proceed
diff --git a/basicConfig/properties/messages_de.properties b/basicConfig/properties/messages_de.properties
index 780916d0..7b47efe7 100644
--- a/basicConfig/properties/messages_de.properties
+++ b/basicConfig/properties/messages_de.properties
@@ -19,6 +19,7 @@ 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.cancel=Abbrechen
+gui.countryselection.cancle=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
@@ -118,21 +119,29 @@ gui.countryselection.mode.dev=Development
##Other Login Methods page
gui.otherlogin.title=eIDAS-Login Alternative Anmeldemethoden
-gui.otherlogin.header.selection=Wählen Sie eine alternative Anmeldemethode
+gui.otherlogin.header.selection=Personendaten nicht gefunden
gui.otherlogin.button.hs=Handy-Signatur
gui.otherlogin.button.eidas=Alternativer eIDAS Login
gui.otherlogin.button.none=Keine alternative Anmeldemöglichkeit
gui.otherlogin.button.inserternp=Eine neue österreichische Identity auf Basis meiner eIDAS Daten erzeugen
gui.otherlogin.cancel=Abbrechen
-gui.otherlogin.inserternp.infotext=Falls Sie sich noch nie mit eIDAS in Österreich angemeldet haben und Sie auch noch keinen anderen Kontakt zur österreichischen Verwaltung hatten können Sie eine neue österreichischen Identifikatior erzeugen.
+gui.otherlogin.info.first=Ihre Personendaten aus dem eben erfolgten EU-Login konnten in den Registern der österreichischen Verwaltung keinem Registereintrag eindeutig zugeordnet werden. Das kann daran liegen, dass Sie in den Registern bisher nicht eingetragen sind, oder ihre aktuellen Anmeldedaten nicht vollständig mit den in den Registern hinterlegten Daten zu Ihrer Person übereinstimmen.
+gui.otherlogin.info.second=Sie haben folgende Möglichkeiten, um eine korrekte Zuordnung zu erreichen:
+gui.otherlogin.info.list.1=Wenn Sie über eine österreichische Handy-Signatur (oder ID Austria) oder über eine alternative Möglichkeit eines EU-Logins verfügen, melden Sie sich mit diesen bitte erneut an. Verwenden Sie dazu bitte die entsprechende Schaltfläche „Handy-Signatur“ oder „Alternativer EU-Login“.
+gui.otherlogin.info.list.2=Verfügen Sie über keine der beiden oben genannten zusätzlichen Anmeldemöglichkeiten, setzen Sie bitte über die Schaltfläche „Keine alternative Anmeldemöglichkeit“ fort
-module.eidasauth.matching.20=Matching auf Basis eine Wohnanschrift in Österreich wurde abgebrochen. Nutzen Sie eine andere Matchingmethode oder Erzeugen Sie einen neuen österreichischen Identifikator.
-module.eidasauth.matching.21=Das Matching auf Basis eine Wohnanschrift in Österreich schlug fehl. Nutzen Sie eine andere Matchingmethode oder Erzeugen Sie einen neuen österreichischen Identifikator.
-module.eidasauth.matching.22=Das Matching auf Basis eine Wohnanschrift in Österreich schlug fehl. Stellen Sie weitere Informationen bereit, nutzen Sie eine andere Matchingmethode oder Erzeugen Sie einen neuen österreichischen Identifikator.
-module.eidasauth.matching.23=Matching auf Basis eines ID Autria wurde abgebrochen. Nutzen Sie eine andere Matchingmethode oder Erzeugen Sie einen neuen österreichischen Identifikator.
-module.eidasauth.matching.24=Matching auf Basis eines ID Autria schlug fehl. Nutzen Sie eine andere Matchingmethode oder Erzeugen Sie einen neuen österreichischen Identifikator.
-module.eidasauth.matching.25=Matching auf Basis einer alternativen eIDAS Anmeldung schlug fehl. Stellen Sie weitere Informationen bereit, nutzen Sie eine andere Matchingmethode oder Erzeugen Sie einen neuen österreichischen Identifikator.
+gui.otherlogin.inserternp.header.selection=Neueintragung
+gui.otherlogin.inserternp.first=Ihre Personendaten konnten in den Registern der österreichischen Verwaltung keinem Eintrag eindeutig zugeordnet werden.
+gui.otherlogin.inserternp.second=Erlauben Sie die Neueintragung ihrer Personendaten in den Registern der österreichischen Verwaltung, um den Anmeldevorgang erfolgreich abzuschließen.
+gui.otherlogin.inserternp.third.prefix=Achtung: Wenn Sie der Meinung sind, in den Registern der österreichischen Verwaltung bereits einen Eintrag zu haben, wird empfohlen, an dieser Stelle keine Neueintragung Ihrer Daten zu erlauben, um doppelte Einträge zu verhindern. Kontaktieren Sie in diesem Fall bitte
+gui.otherlogin.inserternp.third.postfix=, um eine manuelle Zuordnung der Daten zu veranlassen.
+
+module.eidasauth.matching.21=Das Matching auf Basis eine Wohnanschrift in Österreich schlug fehl. Es wurden nicht alle erforderlichen Parameter für eine Suche mittels Wohnanschrift eingegeben.
+module.eidasauth.matching.22=Das Matching auf Basis eine Wohnanschrift in Österreich schlug fehl. Matching auf Basis einer bestanden oder bestehenden Wohnanschrift konnte nicht durchgeführt werden.
+module.eidasauth.matching.23=Matching auf Basis eines ID Autria wurde abgebrochen. Nutzen Sie eine andere Matchingmethode.
+module.eidasauth.matching.24=Matching auf Basis eines ID Autria schlug fehl. Nutzen Sie eine andere Matchingmethode.
+module.eidasauth.matching.25=Matching auf Basis einer alternativen eIDAS Anmeldung schlug fehl. Stellen Sie weitere Informationen bereit oder nutzen Sie eine andere Matchingmethode.
##Austrian Residency page
@@ -140,9 +149,14 @@ gui.residency.title=Österreichischer Wohnsitz
gui.residency.header.selection=Suche nach Österreichischem Wohnsitz
gui.residency.header.help=Hier können Sie nach einem Wohnsitze in Österreich suchen. Bitte geben Sie zuerst eine \
Postleitzahl, Gemeinde oder Ortschaft ein um die Suche zu starten.
+
+gui.residency.info.first=Haben Sie einen aktuellen oder ehemaligen gemeldeten Wohnsitz in Österreich, kann eine Zuordnung zu Ihrem bestehenden Registereintrag über Eingabe der Wohnsitzdaten erfolgen. Bitte benutzen Sie das untenstehende Formular, um Ihre Wohnsitzdaten einzugeben.
+gui.residency.info.second=Bitte geben Sie dazu zuerst eine Postleitzahl, Gemeinde oder Ortschaft ein und starten Sie die Suche Ihrer Wohnsitzadresse dann über die Schaltfläche „Suche“. Sie werden in weiterer Folge bei der Vervollständigung der Wohnsitzadresse interaktiv unterstützt. Folgen Sie dazu den Anweisungen im Formular. Über die Schaltfläche „Löschen“ können Sie den Suchvorgang jederzeit neu starten. Wurden alle Wohnsitzdaten über die Suchfunktion vollständig befüllt, setzen Sie bitte über die Schaltfläche „Fortfahren“ fort.
+gui.residency.info.third=Haben sie keinen aktuellen oder ehemaligen Wohnsitz in Österreich, setzen Sie bitte über die Schaltfläche „Kein Wohnsitz vorhanden“ fort.
+
gui.residency.header.inputinvalid=Bitte geben Sie einen Wert für Gemeinde oder Ortschaft ein
gui.residency.cancel=Abbrechen
-gui.residency.back=Zurück zum vorangegangenen Schritt
+gui.residency.back=Kein Wohnsitz vorhanden
gui.residency.search=Suche
gui.residency.clear=Löschen
gui.residency.proceed=Fortfahren
diff --git a/basicConfig/templates/language_selection.html b/basicConfig/templates/language_selection.html
index a268eb17..8d34c73b 100644
--- a/basicConfig/templates/language_selection.html
+++ b/basicConfig/templates/language_selection.html
@@ -3,13 +3,13 @@
xmlns:th="http://www.thymeleaf.org">
-
+