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 --- .../auth/eidas/v2/tasks/GenerateOtherLoginMethodGuiTask.java | 7 +++++-- .../v2/tasks/ReceiveOtherLoginMethodGuiResponseTask.java | 11 +++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'modules/authmodule-eIDAS-v2/src/main') 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) { -- cgit v1.2.3