From c1b44dcd325e9e49ba38c384b9bfb981dca5a776 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Tue, 12 Jan 2021 16:10:10 +0100 Subject: add task transitions --- .../auth/eidas/v2/tasks/InitialSearchTask.java | 9 ++++++- .../resources/eIDAS.Authentication.process.xml | 31 ++++++++++++++++++---- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java index a87be6c5..0812f55e 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java @@ -73,6 +73,7 @@ public class InitialSearchTask extends AbstractAuthServletTask { private IErnbClient ernbClient; private IZmrClient zmrClient; + private ExecutionContext executionContext; /* * (non-Javadoc) @@ -86,6 +87,7 @@ public class InitialSearchTask extends AbstractAuthServletTask { public void execute(ExecutionContext executionContext, HttpServletRequest request, HttpServletResponse response) throws TaskExecutionException { try { + this.executionContext = executionContext; final AuthProcessDataWrapper authProcessData = pendingReq.getSessionData(AuthProcessDataWrapper.class); final ILightResponse eidasResponse = authProcessData .getGenericDataFromSession(Constants.DATA_FULL_EIDAS_RESPONSE, ILightResponse.class); @@ -254,7 +256,12 @@ public class InitialSearchTask extends AbstractAuthServletTask { ernbClient.searchWithMds(eidData.getGivenName(), eidData.getFamilyName(), eidData.getDateOfBirth()); mdsSearchResult.setResultsErnb(resultsErnb); - log.debug("Automerge " + initialSearchResult + " with " + eidData + " " + mdsSearchResult); + if (mdsSearchResult.getResultCount() == 0) { + executionContext.put("TASK_CreateNewErnpEntryTask", true); + } else { + executionContext.put("TASK_GenerateGuiTask", true); + } + //TODO implement next phase and return correct value return "TODO-Temporary-Endnode-105"; } 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 5134982a..5299093e 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 @@ -13,15 +13,15 @@ - - - - - @@ -33,8 +33,29 @@ to="receiveAuthnResponse" /> + + + + + + + + + + +