aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2020-12-15 10:01:11 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2021-01-15 14:17:36 +0100
commitb49ccd7d7ec1c0f0b560321b7e5559f18913ae7c (patch)
treef2d12d32dd0e33dd61ef5756ebc2455e3c6163b3 /eidas_modules
parent710cae803e5b6846e1ec2a584bf9be1b57c8d23a (diff)
downloadNational_eIDAS_Gateway-b49ccd7d7ec1c0f0b560321b7e5559f18913ae7c.tar.gz
National_eIDAS_Gateway-b49ccd7d7ec1c0f0b560321b7e5559f18913ae7c.tar.bz2
National_eIDAS_Gateway-b49ccd7d7ec1c0f0b560321b7e5559f18913ae7c.zip
return bPk
Diffstat (limited to 'eidas_modules')
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java53
1 files changed, 31 insertions, 22 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 0b7ce030..bc64dc86 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
@@ -142,25 +142,28 @@ public class InitialSearchTask extends AbstractAuthServletTask {
// post-process eIDAS attributes
final SimpleEidasData eidData = convertSimpleMapToSimpleData(simpleAttrMap);
- step2(eidData);
+
+ String bpK = step2(eidData);
+ authProcessData.setGenericDataToSession(Constants.DATA_RESULT_MATCHING_BPK,bpK);
} catch (final Exception e) {
log.error("Initial search FAILED.", e);
throw new TaskExecutionException(pendingReq, "Initial search FAILED.", e);
}
}
- private void step2(SimpleEidasData eidData) throws TaskExecutionException {
+ private String step2(SimpleEidasData eidData) throws TaskExecutionException {
String personIdentifier = eidData.getPseudonym();
//search in register(step 2)
MergedRegisterSearchResult result = searchInZmrAndErnp(personIdentifier);
if (result.getResultCount() == 0) {
- step5(result, eidData);
+ return step5(result, eidData);
} else if (result.getResultCount() == 1) {
- step3(result, eidData);
- } else if (result.getResultCount() > 1) {
- throw new TaskExecutionException(pendingReq, "Initial search - Kitt Process necessary.",
+ return step3(result, eidData);
+ } //else if (result.getResultCount() > 1) {
+ throw new TaskExecutionException(pendingReq, "Initial search - Kitt Process necessary.",
new ManualFixNecessaryException(personIdentifier));
- }
+ // }
+ // return null;
}
private SimpleEidasData convertSimpleMapToSimpleData(Map<String, Object> eidasAttrMap)
@@ -194,25 +197,30 @@ public class InitialSearchTask extends AbstractAuthServletTask {
return simpleEidasData;
}
- private void step3(MergedRegisterSearchResult result, SimpleEidasData eidData) {
+ private String step3(MergedRegisterSearchResult result, SimpleEidasData eidData) {
//check if data from eidas authentication matches with data from register
log.debug("Compare " + result + " with " + eidData);
//TODO check if data matches
boolean match = true;
if (match) {
- return;
+ String bpK = "102";
+ return bpK;
} else {
- step4(result, eidData);
+ return step4(result, eidData);
}
}
- private void step4(MergedRegisterSearchResult result, SimpleEidasData eidData) {
+ private String step4(MergedRegisterSearchResult result,
+ SimpleEidasData eidData) {
log.debug("Update " + result + " with " + eidData);
//TODO
+
+ String bpK = "100";
+ return bpK;
}
- private void step5(MergedRegisterSearchResult result, SimpleEidasData eidData)
+ private String step5(MergedRegisterSearchResult result, SimpleEidasData eidData)
throws TaskExecutionException {
String citizenCountry = eidData.getCitizenCountryCode();
ICountrySpecificDetailSearchProcessor foundHandler = null;
@@ -227,14 +235,14 @@ public class InitialSearchTask extends AbstractAuthServletTask {
}
if (foundHandler == null) {
//MDS search
- step8(result, eidData);
+ return step8(result, eidData);
} else {
//country specific search
- step6(foundHandler, result, eidData);
+ return step6(foundHandler, result, eidData);
}
}
- private void step6(ICountrySpecificDetailSearchProcessor countrySpecificDetailSearchProcessor,
+ private String step6(ICountrySpecificDetailSearchProcessor countrySpecificDetailSearchProcessor,
MergedRegisterSearchResult initialSearchResult, SimpleEidasData eidData)
throws TaskExecutionException {
//6 country specific search
@@ -243,24 +251,25 @@ public class InitialSearchTask extends AbstractAuthServletTask {
switch (countrySpecificDetailSearchResult.getResultCount()) {
case 0:
- step8(initialSearchResult, eidData);
- break;
+ return step8(initialSearchResult, eidData);
case 1:
- step7a(initialSearchResult, countrySpecificDetailSearchResult, eidData);
- break;
+ return step7a(initialSearchResult, countrySpecificDetailSearchResult, eidData);
default://should not happen
throw new TaskExecutionException(pendingReq, "Detail search - Kitt Process necessary.",
new ManualFixNecessaryException(eidData));
}
}
- private void step7a(MergedRegisterSearchResult initialSearchResult,
+ private String step7a(MergedRegisterSearchResult initialSearchResult,
CountrySpecificDetailSearchResult countrySpecificDetailSearchResult, SimpleEidasData eidData) {
//TODO automerge
log.debug("Automerge " + initialSearchResult + " with " + eidData + " " + countrySpecificDetailSearchResult);
+ String bpK = "103";
+ return bpK;
}
- private void step8(MergedRegisterSearchResult initialSearchResult, SimpleEidasData eidData) {
+ private String step8(MergedRegisterSearchResult initialSearchResult,
+ SimpleEidasData eidData) {
MergedRegisterSearchResult mdsSearchResult = new MergedRegisterSearchResult();
ArrayList<RegisterResult> resultsZmr =
@@ -273,7 +282,7 @@ public class InitialSearchTask extends AbstractAuthServletTask {
log.debug("Automerge " + initialSearchResult + " with " + eidData + " " + mdsSearchResult);
//TODO
-
+ return "105";
}
private MergedRegisterSearchResult searchInZmrAndErnp(String personIdentifier) {