aboutsummaryrefslogtreecommitdiff
path: root/modules/authmodule-eIDAS-v2/src/main
diff options
context:
space:
mode:
authorThomas <>2022-10-21 11:11:36 +0200
committerThomas <>2022-10-21 11:11:36 +0200
commit55ab5856a90b065b2a645a62112b380f06cf751c (patch)
tree4c0be982a90e655a816464d0b51d272bf94c6bce /modules/authmodule-eIDAS-v2/src/main
parent8c09e7fbee0f8e1bc5e1c6e89e2aaf6fa4bec7a5 (diff)
downloadNational_eIDAS_Gateway-55ab5856a90b065b2a645a62112b380f06cf751c.tar.gz
National_eIDAS_Gateway-55ab5856a90b065b2a645a62112b380f06cf751c.tar.bz2
National_eIDAS_Gateway-55ab5856a90b065b2a645a62112b380f06cf751c.zip
feat(matching): distiguish between create ERnP entry by automated process or by user decision
Diffstat (limited to 'modules/authmodule-eIDAS-v2/src/main')
-rw-r--r--modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java10
-rw-r--r--modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateNewErnpEntryTask.java11
-rw-r--r--modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java5
-rw-r--r--modules/authmodule-eIDAS-v2/src/main/resources/eIDAS.Authentication.process.xml2
4 files changed, 24 insertions, 4 deletions
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java
index faf38b64..0d0d11f8 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java
@@ -336,10 +336,20 @@ public class Constants {
/**
* {@link at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.CreateNewErnpEntryTask}.
+ *
+ * <p>In case of an automated decision to create ERnP entry</p>
*/
public static final String TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_TASK = "TASK_CreateNewErnpEntryTask";
/**
+ * {@link at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.CreateNewErnpEntryTask}.
+ *
+ * <p>In case of an user decision to create ERnP entry</p>
+ */
+ public static final String TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_BY_USER_TASK =
+ "TASK_CreateNewErnpEntryByUserTask";
+
+ /**
* {@link at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.GenerateOtherLoginMethodGuiTask}.
*/
public static final String TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK =
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateNewErnpEntryTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateNewErnpEntryTask.java
index 563a66ba..5926adc6 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateNewErnpEntryTask.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateNewErnpEntryTask.java
@@ -23,6 +23,8 @@
package at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks;
+import java.io.Serializable;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -93,7 +95,7 @@ public class CreateNewErnpEntryTask extends AbstractAuthServletTask {
// finish matching process, because new user-entry uniquly matches
log.info("User successfully registerred into ERnP and matching tasks are finished ");
- MatchingTaskUtils.setMatchingState(pendingReq, MatchingStates.BY_NEW_ERNP_ENTRY);
+ MatchingTaskUtils.setMatchingState(pendingReq, selectMatchingStateByContextInfos(executionContext));
MatchingTaskUtils.storeFinalMatchingResult(pendingReq,
MatchedPersonResult.generateFormMatchingResult(
resp.getPersonResult().get(0), simpleEidasData.getCitizenCountryCode()));
@@ -104,4 +106,11 @@ public class CreateNewErnpEntryTask extends AbstractAuthServletTask {
}
}
+ private MatchingStates selectMatchingStateByContextInfos(ExecutionContext executionContext) {
+ Serializable flag = executionContext.get(Constants.TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_BY_USER_TASK);
+ return flag != null && (boolean) flag
+ ? MatchingStates.BY_USER_TO_NEW_ERNP_ENTRY : MatchingStates.BY_NEW_ERNP_ENTRY;
+
+ }
+
}
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 5b966ffe..fb4e6e7b 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
@@ -73,7 +73,8 @@ public class ReceiveOtherLoginMethodGuiResponseTask extends AbstractLocaleAuthSe
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);
+ Constants.TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_TASK,
+ Constants.TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_BY_USER_TASK);
@Override
public void executeWithLocale(ExecutionContext executionContext, HttpServletRequest request,
@@ -146,7 +147,7 @@ public class ReceiveOtherLoginMethodGuiResponseTask extends AbstractLocaleAuthSe
case ADD_ME_AS_NEW:
log.info("User selects insert-into-ERnP option. Starting ERnP operation and complete prozess ... ");
- executionContext.put(Constants.TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_TASK, true);
+ executionContext.put(Constants.TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_BY_USER_TASK, true);
executionContext.put(Constants.TRANSITION_TO_REQUESTING_NEW_ERNP_ENTRY_TASK, false);
return;
diff --git a/modules/authmodule-eIDAS-v2/src/main/resources/eIDAS.Authentication.process.xml b/modules/authmodule-eIDAS-v2/src/main/resources/eIDAS.Authentication.process.xml
index e57f9ca6..3a37a82b 100644
--- a/modules/authmodule-eIDAS-v2/src/main/resources/eIDAS.Authentication.process.xml
+++ b/modules/authmodule-eIDAS-v2/src/main/resources/eIDAS.Authentication.process.xml
@@ -47,7 +47,7 @@
from="receiveOtherLoginMethodGuiResponseTask" to="generateAustrianResidenceGuiTask" />
<pd:Transition conditionExpression="ctx['TASK_RequestingNewErnpEntryTask']"
from="receiveOtherLoginMethodGuiResponseTask" to="generateOtherLoginMethodGuiTask" />
- <pd:Transition conditionExpression="ctx['TASK_CreateNewErnpEntryTask']"
+ <pd:Transition conditionExpression="ctx['TASK_CreateNewErnpEntryByUserTask']"
from="receiveOtherLoginMethodGuiResponseTask" to="createNewErnpEntryTask" />
<!-- alternative eIDAS authentication -->