aboutsummaryrefslogtreecommitdiff
path: root/modules/authmodule-eIDAS-v2
diff options
context:
space:
mode:
authorThomas <>2022-03-10 18:04:20 +0100
committerThomas <>2022-03-10 18:04:20 +0100
commitf2df62788d1c47aea5dc16d985fd8b4fd9fa424c (patch)
treedb79f4acb377499dbf7794264ec4ec7c6cf18fe2 /modules/authmodule-eIDAS-v2
parentdf962dfa24bf11b67c8ffbca0e581ef36613b004 (diff)
downloadNational_eIDAS_Gateway-f2df62788d1c47aea5dc16d985fd8b4fd9fa424c.tar.gz
National_eIDAS_Gateway-f2df62788d1c47aea5dc16d985fd8b4fd9fa424c.tar.bz2
National_eIDAS_Gateway-f2df62788d1c47aea5dc16d985fd8b4fd9fa424c.zip
fix(matching): store pendingRequest before next asynch. step
Diffstat (limited to 'modules/authmodule-eIDAS-v2')
-rw-r--r--modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java3
-rw-r--r--modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java8
2 files changed, 11 insertions, 0 deletions
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