aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main')
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java9
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SelectedLoginMethod.java2
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java21
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java5
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/resources/eIDAS.Authentication.process.xml23
5 files changed, 51 insertions, 9 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java
index 5dfc9e68..ee9b00f7 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java
@@ -279,6 +279,14 @@ public class Constants {
public static final String COUNTRY_CODE_DE = "DE";
public static final String COUNTRY_CODE_IT = "IT";
+
+ // UI options
+ public static final String HTML_FORM_ADVANCED_MATCHING_FAILED = "advancedMatchingFailed";
+
+
+ // ProcessEngine context
+ public static final String CONTEXT_FLAG_ADVANCED_MATCHING_FAILED = HTML_FORM_ADVANCED_MATCHING_FAILED;
+
/**
* {@link at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.CreateNewErnpEntryTask}.
*/
@@ -307,6 +315,7 @@ public class Constants {
*/
public static final String TRANSITION_TO_GENERATE_EIDAS_LOGIN = "TASK_GenerateAlternativeEidasAuthn";
+
/**
* Stores login selection from user.
*/
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SelectedLoginMethod.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SelectedLoginMethod.java
index f8e2ff2e..70904e4f 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SelectedLoginMethod.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SelectedLoginMethod.java
@@ -1,5 +1,5 @@
package at.asitplus.eidas.specific.modules.auth.eidas.v2.dao;
public enum SelectedLoginMethod {
- EIDAS_LOGIN, MOBILE_PHONE_SIGNATURE_LOGIN, NO_OTHER_LOGIN
+ EIDAS_LOGIN, MOBILE_PHONE_SIGNATURE_LOGIN, NO_OTHER_LOGIN, ADD_ME_AS_NEW
}
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java
index dbdda78e..7107709f 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.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;
@@ -31,11 +33,12 @@ import org.springframework.stereotype.Component;
import at.asitplus.eidas.specific.connector.MsEidasNodeConstants;
import at.asitplus.eidas.specific.connector.gui.StaticGuiBuilderConfiguration;
-import at.gv.egiz.eaaf.core.api.gui.IGuiBuilderConfiguration;
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants;
import at.gv.egiz.eaaf.core.api.gui.ISpringMvcGuiFormBuilder;
import at.gv.egiz.eaaf.core.api.idp.IConfiguration;
import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext;
import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException;
+import at.gv.egiz.eaaf.core.impl.gui.AbstractGuiFormBuilderConfiguration;
import at.gv.egiz.eaaf.core.impl.idp.auth.modules.AbstractAuthServletTask;
import lombok.extern.slf4j.Slf4j;
@@ -62,7 +65,7 @@ public class GenerateOtherLoginMethodGuiTask extends AbstractAuthServletTask {
public void execute(ExecutionContext executionContext, HttpServletRequest request, HttpServletResponse response)
throws TaskExecutionException {
try {
- final IGuiBuilderConfiguration config = new StaticGuiBuilderConfiguration(
+ final StaticGuiBuilderConfiguration config = new StaticGuiBuilderConfiguration(
basicConfig,
pendingReq,
basicConfig.getBasicConfiguration(
@@ -71,6 +74,13 @@ public class GenerateOtherLoginMethodGuiTask extends AbstractAuthServletTask {
MsEidasNodeConstants.ENDPOINT_OTHER_LOGIN_METHOD_SELECTION,
resourceLoader);
+ // inject flag to indicate advanced matching error
+ if (getExecutionContextFlag(executionContext, Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED)) {
+ config.putCustomParameter(AbstractGuiFormBuilderConfiguration.PARAM_GROUP_UIOPTIONS,
+ Constants.HTML_FORM_ADVANCED_MATCHING_FAILED, String.valueOf(true));
+
+ }
+
guiBuilder.build(request, response, config, "Other login methods selection form");
} catch (final Exception e) {
@@ -79,4 +89,11 @@ public class GenerateOtherLoginMethodGuiTask extends AbstractAuthServletTask {
}
}
+ private boolean getExecutionContextFlag(ExecutionContext executionContext, String key) {
+ Serializable value = executionContext.get(key);
+ return value instanceof Boolean && (boolean)value
+ || value instanceof String && Boolean.parseBoolean((String) value);
+
+ }
+
}
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java
index 8431d968..c2c1a351 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java
@@ -70,6 +70,7 @@ public class ReceiveOtherLoginMethodGuiResponseTask extends AbstractLocaleAuthSe
try {
SelectedLoginMethod selection = SelectedLoginMethod.valueOf(extractUserSelection(request));
executionContext.put(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER, selection);
+ executionContext.remove(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED);
transitionToNextTask(executionContext, selection);
} catch (final IllegalArgumentException e) {
@@ -113,6 +114,10 @@ public class ReceiveOtherLoginMethodGuiResponseTask extends AbstractLocaleAuthSe
executionContext.put(Constants.TRANSITION_TO_GENERATE_GUI_QUERY_AUSTRIAN_RESIDENCE_TASK, true);
return;
+ case ADD_ME_AS_NEW:
+ executionContext.put(Constants.TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_TASK, true);
+ return;
+
default:
throw new InvalidUserInputException("module.eidasauth.matching.98");
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/eIDAS.Authentication.process.xml b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/eIDAS.Authentication.process.xml
index 59aef423..c9bdad94 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/eIDAS.Authentication.process.xml
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/eIDAS.Authentication.process.xml
@@ -33,6 +33,7 @@
from="initialRegisterSearch" to="generateOtherLoginMethodGuiTask"/>
<pd:Transition from="initialRegisterSearch" to="generateIdentityLink" />
+ <!-- alternative matching modes -->
<pd:Transition from="generateOtherLoginMethodGuiTask" to="receiveOtherLoginMethodGuiResponseTask" />
<pd:Transition conditionExpression="ctx['TASK_GenerateAlternativeEidasAuthn']"
from="receiveOtherLoginMethodGuiResponseTask" to="generateAlternativeEidasAuthnRequest" />
@@ -40,25 +41,35 @@
from="receiveOtherLoginMethodGuiResponseTask" to="generateMobilePhoneSignatureRequestTask" />
<pd:Transition conditionExpression="ctx['TASK_GenerateAustrianResidenceGuiTask']"
from="receiveOtherLoginMethodGuiResponseTask" to="generateAustrianResidenceGuiTask" />
+ <pd:Transition conditionExpression="ctx['TASK_CreateNewErnpEntryTask']"
+ from="receiveOtherLoginMethodGuiResponseTask" to="createNewErnpEntryTask" />
+ <!-- alternative eIDAS authentication -->
<pd:Transition from="generateAlternativeEidasAuthnRequest" to="receiveAlternativeEidasAuthnRequest" />
- <pd:Transition from="receiveAlternativeEidasAuthnRequest" to="alternativeRegisterSearch" />
+ <pd:Transition from="receiveAlternativeEidasAuthnRequest" to="alternativeRegisterSearch" />
<pd:Transition conditionExpression="ctx['TASK_GenerateOtherLoginMethodGuiTask']"
- from="alternativeRegisterSearch" to="generateAustrianResidenceGuiTask" />
+ from="alternativeRegisterSearch" to="generateOtherLoginMethodGuiTask" />
<pd:Transition from="alternativeRegisterSearch" to="generateIdentityLink" />
+
+ <!-- ID Austria authentication -->
<pd:Transition from="generateMobilePhoneSignatureRequestTask" to="receiveMobilePhoneSignatureResponseTask" />
<pd:Transition conditionExpression="ctx['TASK_GenerateAustrianResidenceGuiTask']"
- from="receiveMobilePhoneSignatureResponseTask" to="generateAustrianResidenceGuiTask" />
+ from="receiveMobilePhoneSignatureResponseTask" to="generateOtherLoginMethodGuiTask" />
<pd:Transition from="receiveMobilePhoneSignatureResponseTask" to="generateIdentityLink" />
- <pd:Transition from="generateAustrianResidenceGuiTask" to="receiveAustrianResidenceGuiResponseTask" />
+
+ <!-- address searching -->
+ <pd:Transition from="generateAustrianResidenceGuiTask" to="receiveAustrianResidenceGuiResponseTask" />
+ <pd:Transition conditionExpression="ctx['TASK_GenerateOtherLoginMethodGuiTask']"
+ from="receiveAustrianResidenceGuiResponseTask" to="generateOtherLoginMethodGuiTask" />
<pd:Transition conditionExpression="ctx['TASK_CreateNewErnpEntryTask']"
- from="receiveAustrianResidenceGuiResponseTask" to="createNewErnpEntryTask" />
+ from="receiveAustrianResidenceGuiResponseTask" to="createNewErnpEntryTask" />
<pd:Transition from="receiveAustrianResidenceGuiResponseTask" to="generateIdentityLink" />
+
<pd:Transition from="createNewErnpEntryTask" to="generateIdentityLink" />
- <!-- TODO end-->
+
<pd:Transition from="generateIdentityLink" to="finalizeAuthentication" />
<pd:Transition from="finalizeAuthentication" to="end" />