diff options
author | Thomas <> | 2022-07-05 17:49:34 +0200 |
---|---|---|
committer | Thomas <> | 2022-07-05 17:49:34 +0200 |
commit | b5766d8107d6e557921f9a694893a1284963ef16 (patch) | |
tree | 708e695bb0c90d958ef0e3cde6008169fb683893 | |
parent | 154f7f2a9c8a33d3fedf341df2be62d8404ff77f (diff) | |
parent | 48695aa01a86890990dc4e42b9d44493ec840b25 (diff) | |
download | National_eIDAS_Gateway-b5766d8107d6e557921f9a694893a1284963ef16.tar.gz National_eIDAS_Gateway-b5766d8107d6e557921f9a694893a1284963ef16.tar.bz2 National_eIDAS_Gateway-b5766d8107d6e557921f9a694893a1284963ef16.zip |
Merge branch 'nightlybuild' into feature/ms_proxy_service
42 files changed, 456 insertions, 84 deletions
@@ -92,6 +92,14 @@ The full release package will be located add ## Changelog +**v1.3.1** + +- Optimierung und Fehlerkorrektur bei UX basierten Matching-Schritten + - Konfigurierbare Maximalanzahl von Ergebnissen bei Adresssuche + - Statistiklogger um Matching-Informationen erweitert + - Bugfix + - Sortierung bei Adresssuchergebnissen optimiert + **v1.3.0** - Erweitertes Identitätsmatching welches sowohl bestehende ZMR und ERnP Einträge berücksichtigt diff --git a/basicConfig/ms-connector/default_config.properties b/basicConfig/ms-connector/default_config.properties index b14c0221..e1aff309 100644 --- a/basicConfig/ms-connector/default_config.properties +++ b/basicConfig/ms-connector/default_config.properties @@ -30,6 +30,9 @@ eidas.ms.auth.eIDAS.node_v2.forward.endpoint= ############################################# #### eIDAS identity-matching ###### +eidas.ms.auth.eIDAS.matching.byaddress.enable=true + + # ZMR communication eidas.ms.auth.eIDAS.zmrclient.endpoint=https://stportal.bmi.gv.at/at.gv.bmi.zmrsrv-a/soap/ZMRService eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.type=pkcs12 diff --git a/basicConfig/ms-connector/properties/messages.properties b/basicConfig/ms-connector/properties/messages.properties index 8d2b692c..bac206f0 100644 --- a/basicConfig/ms-connector/properties/messages.properties +++ b/basicConfig/ms-connector/properties/messages.properties @@ -151,7 +151,7 @@ gui.countryselection.country.uk.img = /img/countries/UnitedKingdom-EU_.png gui.otherlogin.title=eIDAS-Login Other Login Methods gui.otherlogin.header.selection=Personal data not found -gui.otherlogin.info.first=Your personal data from the conducted EU login could not be clearly assigned to any register entry in the registers of the Austrian administration. This may be due to a missing register entry of your personal data, or an incorrect match of your login data and your register entry stored in the registers. +gui.otherlogin.info.first=Your personal data from the EU login could not be clearly assigned to any register entry in the registers of the Austrian administration. This may be due to a missing register entry of your personal data, or an incorrect match of your login data and your register entry stored in the registers. gui.otherlogin.info.second=The following describes options to achieve a correct assignment: gui.otherlogin.info.list.1=If you have an Austrian Mobile-Phone Signature (or ID Austria) or an alternative possibility of an EU login, please log in again using one of these options. For this purpose, please use the corresponding button for “ID Austria” or “Alternative EU-Login”. gui.otherlogin.info.list.2=If you do not have either of the two additional registration options mentioned above, please continue with the button “No alternative login”. @@ -162,9 +162,9 @@ gui.otherlogin.button.none=No alternative login gui.otherlogin.button.inserternp=Create new register entry gui.otherlogin.cancel=Cancel -gui.otherlogin.inserternp.header.selection=Re-registration +gui.otherlogin.inserternp.header.selection=New registration gui.otherlogin.inserternp.first=Your personal data could not be clearly assigned to any entry in the registers of the Austrian administration. -gui.otherlogin.inserternp.second=Allow the re-registration of your personal data in the registers of the Austrian administration to complete the registration process successfully. +gui.otherlogin.inserternp.second=Allow the registration of your personal data in the registers of the Austrian administration to complete the registration process successfully. gui.otherlogin.inserternp.third.prefix=Attention: If you think you already have an entry in the registers of the Austrian administration, it is recommended not to allow your data to be entered again at this point in order to avoid double entries. In this case, please contact gui.otherlogin.inserternp.third.postfix=, to arrange a manual assignment of your personal data. @@ -190,10 +190,10 @@ module.eidasauth.matching.99=Matching failed, because of an unexpected processin gui.residency.title=Austrian Residency gui.residency.header.selection=Search for Austrian residence gui.residency.header.help=You can search for the address that you have been registered at in the past. Please enter a \ - postcode, municipality or village first to start the search. + postal code, municipality, or city first to start the search. gui.residency.info.first=If you have a current or former registered residence in Austria, an assignment to your existing register entry can be made by entering the residence data. Please use the form below to enter your residence details. -gui.residency.info.second=First, please enter a postal code, municipality or locality and subsequently start the search for your home address using the "Search" button. Afterwards, you will be interactively supported in completing the address of residence, where you just have to follow the instructions on the form. You can restart the search process at any time by clicking the button "Delete". If all residence data has been filled in completely via the search function, please continue with the button "Continue". +gui.residency.info.second=First, please enter a postal code, municipality, or city and subsequently start the search for your home address using the "Search" button. Afterwards, you will be interactively supported in completing the address of residence, where you just have to follow the instructions on the form. You can restart the search process at any time by clicking the button "Clear". If all residence data has been filled in completely via the search function, please continue with the button "Continue". gui.residency.info.third=If you do not have a current or former place of residence in Austria, please continue with the button "No residence available". gui.residency.header.inputinvalid=Be sure to enter a value for Municipality or Village @@ -203,12 +203,13 @@ gui.residency.search=Search gui.residency.clear=Clear gui.residency.proceed=Continue gui.residency.updated=Updated your input +gui.residency.noentry=no results found gui.residency.found=Found {0} results, click on one result to refine your search -gui.residency.unique=Unique result found, please proceed +gui.residency.unique=Unique result found, please proceed by clicking button Continue gui.residency.error=Error on Backend Call -gui.residency.input.postleitzahl=Postcode +gui.residency.input.postleitzahl=Postal Code gui.residency.input.municipality=Municipality -gui.residency.input.village=Village +gui.residency.input.village=City gui.residency.input.street=Street gui.residency.input.number=Number diff --git a/basicConfig/ms-connector/properties/messages_de.properties b/basicConfig/ms-connector/properties/messages_de.properties index 76624ebe..1686e388 100644 --- a/basicConfig/ms-connector/properties/messages_de.properties +++ b/basicConfig/ms-connector/properties/messages_de.properties @@ -104,16 +104,16 @@ gui.countryselection.mode.dev=Development ##Other Login Methods page
gui.otherlogin.title=eIDAS-Login Alternative Anmeldemethoden
gui.otherlogin.header.selection=Personendaten nicht gefunden
-gui.otherlogin.button.hs=ID Austria
-gui.otherlogin.button.eidas=Alternativer eIDAS Login
+gui.otherlogin.button.hs=Handy-Signatur
+gui.otherlogin.button.eidas=Alternativer EU-Login
gui.otherlogin.button.none=Keine alternative Anmeldemöglichkeit
-gui.otherlogin.button.inserternp=Eine neue österreichische Identity auf Basis meiner eIDAS Daten erzeugen
+gui.otherlogin.button.inserternp=Eine neue österreichische elektronische Identität auf Basis meiner eIDAS Daten erzeugen
gui.otherlogin.cancel=Abbrechen
gui.otherlogin.info.first=Ihre Personendaten aus dem eben erfolgten EU-Login konnten in den Registern der österreichischen Verwaltung keinem Registereintrag eindeutig zugeordnet werden. Das kann daran liegen, dass Sie in den Registern bisher nicht eingetragen sind, oder ihre aktuellen Anmeldedaten nicht vollständig mit den in den Registern hinterlegten Daten zu Ihrer Person übereinstimmen.
gui.otherlogin.info.second=Sie haben folgende Möglichkeiten, um eine korrekte Zuordnung zu erreichen:
-gui.otherlogin.info.list.1=Wenn Sie über eine österreichische ID Austria (oder Handy-Signatur) oder über eine alternative Möglichkeit eines EU-Logins verfügen, melden Sie sich mit diesen bitte erneut an. Verwenden Sie dazu bitte die entsprechende Schaltfläche „ID Austria“ oder „Alternativer EU-Login“.
-gui.otherlogin.info.list.2=Verfügen Sie über keine der beiden oben genannten zusätzlichen Anmeldemöglichkeiten, setzen Sie bitte über die Schaltfläche „Keine alternative Anmeldemöglichkeit“ fort
+gui.otherlogin.info.list.1=Wenn Sie über eine österreichische Handy-Signatur (oder ID Austria) oder über eine alternative Möglichkeit eines EU-Logins verfügen, melden Sie sich mit diesen bitte erneut an. Verwenden Sie dazu bitte die entsprechende Schaltfläche "Handy-Signatur" oder "Alternativer EU-Login".
+gui.otherlogin.info.list.2=Verfügen Sie über keine der beiden oben genannten zusätzlichen Anmeldemöglichkeiten, setzen Sie bitte über Schaltfläche "Keine alternative Anmeldemöglichkeit" fort.
gui.otherlogin.inserternp.header.selection=Neueintragung
gui.otherlogin.inserternp.first=Ihre Personendaten konnten in den Registern der österreichischen Verwaltung keinem Eintrag eindeutig zugeordnet werden.
@@ -134,7 +134,7 @@ module.eidasauth.matching.99=Matching schlug Aufgrund eines internen Fehler fehl ##Austrian Residency page
gui.residency.title=Österreichischer Wohnsitz
gui.residency.header.selection=Suche nach Österreichischem Wohnsitz
-gui.residency.header.help=Hier können Sie nach einem Wohnsitze in Österreich suchen. Bitte geben Sie zuerst eine \
+gui.residency.header.help=Hier können Sie nach einem Wohnsitz in Österreich suchen. Bitte geben Sie zuerst eine \
Postleitzahl, Gemeinde oder Ortschaft ein um die Suche zu starten.
gui.residency.info.first=Haben Sie einen aktuellen oder ehemaligen gemeldeten Wohnsitz in Österreich, kann eine Zuordnung zu Ihrem bestehenden Registereintrag über Eingabe der Wohnsitzdaten erfolgen. Bitte benutzen Sie das untenstehende Formular, um Ihre Wohnsitzdaten einzugeben.
@@ -148,6 +148,7 @@ gui.residency.search=Suche gui.residency.clear=Löschen
gui.residency.proceed=Fortfahren
gui.residency.updated=Eingabe aktualisiert
+gui.residency.noentry=keine Ergebnisse gefunden
gui.residency.found={0} Ergebnisse gefunden, klicken Sie auf ein Ergebnis um die Suche zu verfeinern
gui.residency.unique=Eindeutiges Ergebnis gefunden, bitte fortfahren
gui.residency.error=Fehler bei Addresssuche
diff --git a/basicConfig/ms-connector/templates/other_login_method.html b/basicConfig/ms-connector/templates/other_login_method.html index 120b0ecd..d392a553 100644 --- a/basicConfig/ms-connector/templates/other_login_method.html +++ b/basicConfig/ms-connector/templates/other_login_method.html @@ -124,20 +124,33 @@ <input type="hidden" name="loginSelection" value="EIDAS_LOGIN"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"/> </form> - <form method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> + + + + <form th:if="${enableMatchingByAddressSearch != null} and ${enableMatchingByAddressSearch}" + method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <button class="primaryButton" type="submit" role="button" value="Keine weitere HS / eIDAS" th:text="#{gui.otherlogin.button.none}">C </button> <input type="hidden" name="loginSelection" value="NO_OTHER_LOGIN"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"/> </form> + <form th:unless="${enableMatchingByAddressSearch != null} and ${enableMatchingByAddressSearch}" + method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> + <button class="primaryButton" type="submit" role="button" value="Keine weitere HS / eIDAS" + th:text="#{gui.otherlogin.button.none}">C + </button> + <input type="hidden" name="loginSelection" value="REQUESTING_NEW_ENTRY"> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"/> + </form> + </div> <div id="stopMatching" class="block"> <!-- Abbrechen Button --> <form class="block,singleButton" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <button type="submit" value="Abbrechen/Cancel" th:text="#{gui.otherlogin.cancel}"></button> - <input type="hidden" name="stopAuthProcess" value="true"> + <input type="hidden" name="loginSelection" value="STOP_MATCHING_PROCESS"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"> </form> </div> diff --git a/basicConfig/ms-connector/templates/residency.html b/basicConfig/ms-connector/templates/residency.html index 26812ec0..de77269f 100644 --- a/basicConfig/ms-connector/templates/residency.html +++ b/basicConfig/ms-connector/templates/residency.html @@ -33,6 +33,7 @@ function search() { let updatedText = /*[[#{gui.residency.updated}]]*/ 'Updated text'; let errorText = /*[[#{gui.residency.error}]]*/ 'Error'; + let emptyText = /*[[#{gui.residency.noentry}]]*/ 'Found {0}' let foundText = /*[[#{gui.residency.found}]]*/ 'Found {0}'; let uniqueText = /*[[#{gui.residency.unique}]]*/ 'Unique'; let invalidInputText = /*[[#{gui.residency.header.inputinvalid}]]*/ 'Invalid'; @@ -57,7 +58,12 @@ $("#inputForm #inputNumber").val(data["results"][0]["number"]); return; } - $("#textResult").show().text(foundText.replace("{0}", data["resultCount"])); + + if (data["resultCount"] === 0) { + $("#textResult").show().text(emptyText); + } else { + $("#textResult").show().text(foundText.replace("{0}", data["resultCount"])); + } $("#tableResult").show(); $("#tableResult tbody").empty(); $.each(data.results, function (i, output) { diff --git a/build_reporting/pom.xml b/build_reporting/pom.xml index fedf9e18..06f59ed7 100644 --- a/build_reporting/pom.xml +++ b/build_reporting/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>at.asitplus.eidas</groupId> <artifactId>ms_specific</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <artifactId>build_reporting</artifactId> <packaging>pom</packaging> diff --git a/infos/handbook/Handbuch_MS-eIDAS-Node.pdf b/infos/handbook/Handbuch_MS-eIDAS-Node.pdf Binary files differindex c61dc7b9..e26d1fe7 100644 --- a/infos/handbook/Handbuch_MS-eIDAS-Node.pdf +++ b/infos/handbook/Handbuch_MS-eIDAS-Node.pdf diff --git a/infos/ms-connector/Handbuch_MS-eIDAS-Node.docx b/infos/ms-connector/Handbuch_MS-eIDAS-Node.docx Binary files differindex 86e7b596..02406cf1 100644 --- a/infos/ms-connector/Handbuch_MS-eIDAS-Node.docx +++ b/infos/ms-connector/Handbuch_MS-eIDAS-Node.docx diff --git a/infos/ms-connector/history.txt b/infos/ms-connector/history.txt index 73c2bdf7..5dbe4d56 100644 --- a/infos/ms-connector/history.txt +++ b/infos/ms-connector/history.txt @@ -1,5 +1,13 @@ Dieses Dokument zeigt die Veränderungen und Erweiterungen am eIDAS MS-Connector +Version 1.3.1 (2022-07-05): + - Optimierung und Fehlerkorrektur für UX basierten Matching-Schritten + - Konfigurierbare Maximalanzahl von Ergebnissen bei Adresssuche + - Statistiklogger um Matching-Informationen erweitert + - Bugfix + - Sortierung bei Adresssuchergebnissen optimiert + + Version 1.3.0 (2022-05-19): - Mindestens Java 11 erforderlich - Erweitertes Identitätsmatching welches sowohl bestehende ZMR und ERnP Einträge berücksichtigt diff --git a/infos/readme_1.3.1.md b/infos/readme_1.3.1.md new file mode 100644 index 00000000..70db47a9 --- /dev/null +++ b/infos/readme_1.3.1.md @@ -0,0 +1,69 @@ +# MS-Connector v1.3.1 Release vom 05.07.2022 + +Der MS-Connector implementiert eine Bridge zwischen dem österreichischen E-ID System und dem eIDAS Framework um ausländischen Benutzern eine Anmeldung am österreichischen Service-Providern zu ermöglichen. + +### Änderungen in dieser Version + + - Optimierung und Fehlerkorrektur bei UX basierten Matching-Schritten + - Konfigurierbare Maximalanzahl von Ergebnissen bei Adresssuche + - Statistiklogger um Matching-Informationen erweitert + - Bugfix + - Sortierung bei Adresssuchergebnissen optimiert + + +### Durchführen eines Updates + +Nachfolgend finden Sie die erforderlichen Schritte für das Update eines bestehenden MS-specific eIDAS Connectors auf die aktuelle Version 1.3.1. Das vollständige Handbuch mit allen Konfigurationsparametern finden Sie im Releasepackage im Verzeichnis: _infos/handbook/_ + +### Ausgehend von einer bestehenden Version 1.3.0 + +1. Stoppen Sie die *MS-Connector* Applikation und fertigen Sie eine Sicherungskopie Ihrer Applikation inklusive Konfiguration an + +2. Entpacken Sie das Releasepacket *ms_specific_connector-1.3.1-dist.zip* in ein temporäres Verzeichnis welches in weiterer Folge __MsConnectorPackage__ bezeichnet wird. + +3. Kopieren sie die Applikation __MsConnectorPackage__/ms_connector.war nach in das Applikationsverzeichnis ihres Applikationsservers + +4. Update bestehender Dateien . Die nachfolgenden Dateien wurden geändert und erfordern eine Anpassung oder eine Übernahme dem Releasepacket, sofern die Anpassung nicht bereits durchgeführt wurde + + * Vollständige Übernahme: __MsConnectorPackage__/config/templates/other_login_method.html + * Vollständige Übernahme: __MsConnectorPackage__/config/templates/residency.html + * Vollständige Übernahme: __MsConnectorPackage__/config/properties/messages.properties + * Vollständige Übernahme: __MsConnectorPackage__/config/properties/messages_de.properties + +6. Neue optionale Konfigurationsparameter + + - *Matching allgemein* + + - ```eidas.ms.auth.eIDAS.matching.byaddress.enable``` + - ```eidas.ms.auth.eIDAS.matching.byaddress.maxresults``` + +6. Aktualisierung Statistiklogger + + Der CSV Eintrag des Statistikloggers wurde um ein Element erweitert, welches den für den Anmeldeprozess erfolgreichen Matchingschritt ausweist. + + z.B.: + + ```2022.07.01-16:51:58+CEST,65ed49c5-a494-4bfd-a860-ae7988dbf010,https://eid.egiz.gv.at/authHandler/restricted/eidas/metadata,https://eid.egiz.gv.at/openID_demo/,urn:publicid:gv.at:cdid+GH,EE,BY_PERSONALID,success,,``` + + + + Folgende Matching-Status werden durch den Statistik-Logger gesetzt: + + - BY_PERSONALID --> Matching über eIDAS PersonalIdentifier + + BY_COUNTRY_SPECIFIC --> Matching über länderspezifische Eigenschaften (z.B. für DE) + + BY_ID_AUSTRIA --> Matching via ID Austria Login + + BY_EIDAS --> Matching via alternativer eIDAS Anmeldung + + BY_ADDRESS --> Matching über Adresssuche + + BY_NEW_ERNP_ENTRY --> falls die Person neu angelegt wurde + + CANCELED_BY_USER --> Anmeldeprozess wurde durch den Benutzer bei GUI basierten Matching-Prozess abgebrochen + + NO_REQUIRED --> Falls für den aktuellen Anmeldeprozess kein / noch kein Matching erforderlich war (z.B. Fehler am eIDAS Node vor Matching) + + + + + + + + + + diff --git a/modules/authmodule-eIDAS-v2/pom.xml b/modules/authmodule-eIDAS-v2/pom.xml index cfc7ac94..9c1e5113 100644 --- a/modules/authmodule-eIDAS-v2/pom.xml +++ b/modules/authmodule-eIDAS-v2/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>at.asitplus.eidas.ms_specific</groupId> <artifactId>modules</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <groupId>at.asitplus.eidas.ms_specific.modules</groupId> <artifactId>authmodule-eIDAS-v2</artifactId> 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 e766fc49..3c41bf0a 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 @@ -128,7 +128,15 @@ public class Constants { public static final String CONIG_PROPS_EIDAS_COMMON_CLIENT_SSL_TRUSTSTORE_NAME = CONIG_PROPS_EIDAS_COMMON_CLIENT + ".ssl.trustStore.name"; - + /** Enable / Disable matching based on address search. **/ + public static final String CONFIG_PROP_MATCHING_BY_ADDRESS = + EidasConstants.CONIG_PROPS_EIDAS_PREFIX + ".matching.byaddress.enable"; + + public static final String CONFIG_PROP_MATCHING_BY_ADDRESS_MAX_RESULTS = + EidasConstants.CONIG_PROPS_EIDAS_PREFIX + ".matching.byaddress.maxresults"; + public static final String DEFAULT_MATCHING_BY_ADDRESS_MAX_RESULTS = "250"; + + // ZMR Client configuration properties public static final String CONIG_PROPS_EIDAS_ZMRCLIENT = EidasConstants.CONIG_PROPS_EIDAS_PREFIX + ".zmrclient"; @@ -312,6 +320,7 @@ public class Constants { // UI options + public static final String HTML_FORM_ENABLE_MATCHING_BY_ADDRESS_SEARCH = "enableMatchingByAddressSearch"; public static final String HTML_FORM_CREATE_NEW_ERNP_ENTRY = "createNewErnpEntry"; public static final String HTML_FORM_ADVANCED_MATCHING_FAILED = "advancedMatchingFailed"; public static final String HTML_FORM_ADVANCED_MATCHING_FAILED_REASON = diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/controller/AdresssucheController.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/controller/AdresssucheController.java index 6f49c700..a08128d3 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/controller/AdresssucheController.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/controller/AdresssucheController.java @@ -25,6 +25,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.controller; import java.util.Collection; import java.util.Collections; +import java.util.Comparator; import java.util.List; import java.util.Set; import java.util.stream.Collectors; @@ -40,12 +41,14 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import at.asitplus.eidas.specific.core.MsEidasNodeConstants; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.clients.zmr.ZmrAddressSoapClient; import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.EidasSAuthenticationException; import at.gv.bmi.namespace.zmr_su.zrm._20040201_.address.Adressdaten; import at.gv.e_government.reference.namespace.persondata.de._20040201.PostAdresseTyp; import at.gv.e_government.reference.namespace.persondata.de._20040201.ZustelladresseTyp; import at.gv.egiz.eaaf.core.api.data.EaafConstants; +import at.gv.egiz.eaaf.core.api.idp.IConfiguration; import at.gv.egiz.eaaf.core.api.utils.IPendingRequestIdGenerationStrategy; import at.gv.egiz.eaaf.core.exceptions.PendingReqIdValidationException; import lombok.AllArgsConstructor; @@ -67,17 +70,19 @@ public class AdresssucheController { public static final String PARAM_VILLAGE = "village"; public static final String PARAM_STREET = "street"; public static final String PARAM_NUMBER = "number"; - + + @Autowired IConfiguration basicConfig; + @Autowired private ZmrAddressSoapClient client; @Autowired private IPendingRequestIdGenerationStrategy pendingReqGeneration; - + /** * Performs search for addresses in ZMR. */ - @RequestMapping(value = {MsEidasNodeConstants.ENDPOINT_RESIDENCY_SEARCH}, method = {RequestMethod.POST}) + @RequestMapping(value = { MsEidasNodeConstants.ENDPOINT_RESIDENCY_SEARCH }, method = { RequestMethod.POST }) public ResponseEntity<AdresssucheResult> search( @RequestParam(PARAM_POSTLEITZAHL) String postleitzahl, @RequestParam(PARAM_MUNIPICALITY) String municipality, @@ -90,26 +95,26 @@ public class AdresssucheController { municipality.replaceAll("[\r\n]", ""), village.replaceAll("[\r\n]", ""), street.replaceAll("[\r\n]", ""), - number.replaceAll("[\r\n]", "")); + number.replaceAll("[\r\n]", "")); try { pendingReqGeneration.validateAndGetPendingRequestId(pendingId); - - } catch (PendingReqIdValidationException e) { + + } catch (final PendingReqIdValidationException e) { log.warn("Search with pendingId '{}' is not valid", pendingId.replaceAll("[\r\n]", "")); return ResponseEntity.badRequest().build(); - + } - + try { - Adressdaten searchInput = buildSearchInput(postleitzahl, municipality, village, street, number); - ZmrAddressSoapClient.AddressInfo searchOutput = client.searchAddress(searchInput); - AdresssucheResult output = buildResponse(searchOutput); + final Adressdaten searchInput = buildSearchInput(postleitzahl, municipality, village, street, number); + final ZmrAddressSoapClient.AddressInfo searchOutput = client.searchAddress(searchInput); + final AdresssucheResult output = buildResponse(searchOutput); return ResponseEntity.ok(output); - - } catch (EidasSAuthenticationException e) { + + } catch (final EidasSAuthenticationException e) { log.warn("Search failed", e); return ResponseEntity.badRequest().build(); - + } } @@ -117,27 +122,45 @@ public class AdresssucheController { if (searchOutput.getPersonResult().isEmpty()) { log.warn("No result from ZMR"); return new AdresssucheResult(Collections.emptyList(), 0); - + } - + log.info("Result level is {}", searchOutput.getLevel()); - Set<AdresssucheOutput> result = searchOutput.getPersonResult().stream() + final Set<AdresssucheOutput> result = searchOutput.getPersonResult().stream() .map(Adressdaten::getPostAdresse) .map(it -> new AdresssucheOutput(it.getPostleitzahl(), it.getGemeinde(), it.getOrtschaft(), it.getZustelladresse().getStrassenname(), it.getZustelladresse().getOrientierungsnummer())) .collect(Collectors.toSet()); // TODO Add configuration option for the limit of 30 - List<AdresssucheOutput> sorted = result.stream().sorted().limit(30).collect(Collectors.toList()); - return new AdresssucheResult(sorted, result.size()); + + final List<AdresssucheOutput> sorted = result.stream() + .sorted() + .limit(getMaxResults()) + .collect(Collectors.toList()); + return new AdresssucheResult(sorted, result.size()); + + } + + private long getMaxResults() { + String maxSearchResults = basicConfig.getBasicConfiguration( + Constants.CONFIG_PROP_MATCHING_BY_ADDRESS_MAX_RESULTS, + Constants.DEFAULT_MATCHING_BY_ADDRESS_MAX_RESULTS); + try { + return Long.valueOf(maxSearchResults); + + } catch (Exception e) { + log.warn("Invalid number of max. addressSearchResults. Using default value", e); + return Long.valueOf(Constants.DEFAULT_MATCHING_BY_ADDRESS_MAX_RESULTS); + } } private Adressdaten buildSearchInput(String postleitzahl, - String municipality, - String village, - String street, - String number) { - PostAdresseTyp postAdresse = new PostAdresseTyp(); + String municipality, + String village, + String street, + String number) { + final PostAdresseTyp postAdresse = new PostAdresseTyp(); if (StringUtils.isNotBlank(postleitzahl)) { postAdresse.setPostleitzahl(postleitzahl); } @@ -148,7 +171,7 @@ public class AdresssucheController { postAdresse.setOrtschaft(village); } if (StringUtils.isNotBlank(street) || StringUtils.isNotBlank(number)) { - ZustelladresseTyp zustelladresse = new ZustelladresseTyp(); + final ZustelladresseTyp zustelladresse = new ZustelladresseTyp(); if (StringUtils.isNotBlank(street)) { zustelladresse.setStrassenname(street); } @@ -157,10 +180,10 @@ public class AdresssucheController { } postAdresse.setZustelladresse(zustelladresse); } - Adressdaten searchInput = new Adressdaten(); + final Adressdaten searchInput = new Adressdaten(); searchInput.setPostAdresse(postAdresse); return searchInput; - + } @Data @@ -187,9 +210,41 @@ public class AdresssucheController { .append(this.municipality, o.municipality) .append(this.village, o.village) .append(this.street, o.street) - .append(this.number, o.number) + + /* + * TODO: implement better sort method, because current version results to 1, 10, + * 11, .... 2, 20, 21 + */ + .appendSuper(getCustomIntegerComperatpr().compare(this.number, o.number)) + .toComparison(); } + + private Comparator<String> getCustomIntegerComperatpr() { + return new Comparator<String>() { + @Override + public int compare(String o1, String o2) { + return extractInt(o1) - extractInt(o2); + } + + int extractInt(String s) { + if (StringUtils.isNotEmpty(s)) { + final String num = s.replaceAll("\\D", ""); + try { + // return 0 if no digits found + return num.isEmpty() ? 0 : Integer.parseInt(num); + + } catch (Exception e) { + log.info("Can not parse number from ZMR", e); + + } + } + + return 0; + + } + }; + } } } diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SelectedLoginMethod.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SelectedLoginMethod.java index 70904e4f..c8a2da88 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SelectedLoginMethod.java +++ b/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, ADD_ME_AS_NEW + EIDAS_LOGIN, MOBILE_PHONE_SIGNATURE_LOGIN, NO_OTHER_LOGIN, ADD_ME_AS_NEW, REQUESTING_NEW_ENTRY, STOP_MATCHING_PROCESS } diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/AlternativeSearchTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/AlternativeSearchTask.java index e8fb5b6b..dd46bfea 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/AlternativeSearchTask.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/AlternativeSearchTask.java @@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletResponse; import org.jetbrains.annotations.NotNull; import org.springframework.stereotype.Component; +import at.asitplus.eidas.specific.core.MsEidasNodeConstants.MatchingStates; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.MatchedPersonResult; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; @@ -243,6 +244,7 @@ public class AlternativeSearchTask extends AbstractAuthServletTask { throws WorkflowException, EaafStorageException { MatchedPersonResult result = MatchedPersonResult.generateFormMatchingResult( searchResult.getResult(), eidasData.getCitizenCountryCode()); + MatchingTaskUtils.setMatchingState(pendingReq, MatchingStates.BY_EIDAS); MatchingTaskUtils.storeFinalMatchingResult(pendingReq, result); //remove intermediate matching-state 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 c7843be5..563a66ba 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 @@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import at.asitplus.eidas.specific.core.MsEidasNodeConstants.MatchingStates; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.clients.ernp.ErnpRestClient; import at.asitplus.eidas.specific.modules.auth.eidas.v2.clients.ernp.ErnpRestClient.ErnpRegisterResult; @@ -91,7 +92,8 @@ 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 "); + log.info("User successfully registerred into ERnP and matching tasks are finished "); + MatchingTaskUtils.setMatchingState(pendingReq, MatchingStates.BY_NEW_ERNP_ENTRY); MatchingTaskUtils.storeFinalMatchingResult(pendingReq, MatchedPersonResult.generateFormMatchingResult( resp.getPersonResult().get(0), simpleEidasData.getCitizenCountryCode())); 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 a90c5929..94b29b8e 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 @@ -87,6 +87,11 @@ public class GenerateOtherLoginMethodGuiTask extends AbstractLocaleAuthServletTa } } + // inject flag for matching-by-address allowed + config.putCustomParameter(AbstractGuiFormBuilderConfiguration.PARAM_GROUP_UIOPTIONS, + Constants.HTML_FORM_ENABLE_MATCHING_BY_ADDRESS_SEARCH, + String.valueOf(basicConfig.getBasicConfigurationBoolean(Constants.CONFIG_PROP_MATCHING_BY_ADDRESS))); + // inject request to create a new ERnP entry config.putCustomParameter(AbstractGuiFormBuilderConfiguration.PARAM_GROUP_UIOPTIONS, Constants.HTML_FORM_CREATE_NEW_ERNP_ENTRY, diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java index 3a775837..8e6c7790 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java @@ -34,6 +34,7 @@ import javax.servlet.http.HttpServletResponse; import org.jetbrains.annotations.NotNull; import org.springframework.stereotype.Component; +import at.asitplus.eidas.specific.core.MsEidasNodeConstants.MatchingStates; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.MatchedPersonResult; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; @@ -123,7 +124,8 @@ public class InitialSearchTask extends AbstractAuthServletTask { step6CountrySpecificSearch(executionContext, searchResult.getOperationStatus(), eidasData); } else if (resultCount == 1) { - RegisterResult updatedResult = step3CheckRegisterUpdateNecessary(searchResult, eidasData); + RegisterResult updatedResult = step3CheckRegisterUpdateNecessary(searchResult, eidasData); + MatchingTaskUtils.setMatchingState(pendingReq, MatchingStates.BY_PERSONALID); foundMatchFinalizeTask(updatedResult, eidasData); } else { @@ -151,6 +153,7 @@ public class InitialSearchTask extends AbstractAuthServletTask { } else if (searchResult.getResultCount() == 1) { log.trace("'step6CountrySpecificSearch' finds a person. Forward to 'step7aKittProcess' step ... "); RegisterStatusResults updatedResult = registerSearchService.step7aKittProcess(searchResult, eidasData); + MatchingTaskUtils.setMatchingState(pendingReq, MatchingStates.BY_COUNTRY_SPECIFIC); foundMatchFinalizeTask(updatedResult.getResult(), eidasData); } else { diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveAustrianResidenceGuiResponseTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveAustrianResidenceGuiResponseTask.java index b8fe12fe..403c3355 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveAustrianResidenceGuiResponseTask.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveAustrianResidenceGuiResponseTask.java @@ -41,6 +41,7 @@ import org.springframework.stereotype.Component; import com.google.common.collect.Sets; +import at.asitplus.eidas.specific.core.MsEidasNodeConstants.MatchingStates; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.controller.AdresssucheController; import at.asitplus.eidas.specific.modules.auth.eidas.v2.controller.AdresssucheController.AdresssucheOutput; @@ -186,7 +187,8 @@ public class ReceiveAustrianResidenceGuiResponseTask extends AbstractLocaleAuthS // update register information RegisterStatusResults updateResult = registerSearchService.step7aKittProcess(residencyResult, eidasData); - // store updated result to re-used in CreateIdentityLink step, because there we need bPK and MDS + // store updated result to re-used in CreateIdentityLink step, because there we need bPK and MDS + MatchingTaskUtils.setMatchingState(pendingReq, MatchingStates.BY_ADDRESS); MatchingTaskUtils.storeFinalMatchingResult(pendingReq, MatchedPersonResult.generateFormMatchingResult( updateResult.getResult(), eidasData.getCitizenCountryCode())); @@ -194,6 +196,7 @@ public class ReceiveAustrianResidenceGuiResponseTask extends AbstractLocaleAuthS } else { log.warn("Suspect state FOUND. Matching by residence was neccessary but NO register-update are required!"); // no update required. Data can be used as it is. + MatchingTaskUtils.setMatchingState(pendingReq, MatchingStates.BY_ADDRESS); MatchingTaskUtils.storeFinalMatchingResult(pendingReq, MatchedPersonResult.generateFormMatchingResult( residencyResult.getResult(), eidasData.getCitizenCountryCode())); diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveMobilePhoneSignatureResponseTask.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveMobilePhoneSignatureResponseTask.java index b212d133..57790b01 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveMobilePhoneSignatureResponseTask.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveMobilePhoneSignatureResponseTask.java @@ -47,6 +47,7 @@ import org.opensaml.saml.saml2.core.StatusCode; import org.opensaml.saml.saml2.metadata.IDPSSODescriptor; import org.springframework.stereotype.Component; +import at.asitplus.eidas.specific.core.MsEidasNodeConstants.MatchingStates; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.MatchedPersonResult; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; @@ -204,6 +205,7 @@ public class ReceiveMobilePhoneSignatureResponseTask extends AbstractAuthServlet registerSearchService.step7aKittProcess(registerResult, eidasData); // store search result to re-used in CreateIdentityLink step, because there we need bPK and MDS + MatchingTaskUtils.setMatchingState(pendingReq, MatchingStates.BY_ID_AUSTRIA); MatchingTaskUtils.storeFinalMatchingResult(pendingReq, MatchedPersonResult.generateFormMatchingResult(registerResult.getResult(), eidasData.getCitizenCountryCode())); 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 184ad499..03414f9e 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 @@ -34,9 +34,13 @@ import org.springframework.stereotype.Component; import com.google.common.collect.Sets; +import at.asitplus.eidas.specific.core.MsEidasNodeConstants.MatchingStates; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SelectedLoginMethod; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.utils.MatchingTaskUtils; import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; +import at.gv.egiz.eaaf.core.exceptions.EaafException; +import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; import at.gv.egiz.eaaf.core.impl.idp.controller.tasks.AbstractLocaleAuthServletTask; import lombok.extern.slf4j.Slf4j; @@ -73,15 +77,18 @@ public class ReceiveOtherLoginMethodGuiResponseTask extends AbstractLocaleAuthSe @Override public void executeWithLocale(ExecutionContext executionContext, HttpServletRequest request, - HttpServletResponse response) { + HttpServletResponse response) throws TaskExecutionException { try { SelectedLoginMethod selection = SelectedLoginMethod.valueOf(extractUserSelection(request)); executionContext.put(Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK, false); executionContext.put(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER, selection.name()); executionContext.remove(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED); - executionContext.remove(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED_REASON); - transitionToNextTask(executionContext, selection); + executionContext.remove(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED_REASON); + transitionToNextTask(executionContext, selection, request, response); + } catch (TaskExecutionException e) { + throw e; + } catch (final Exception e) { log.error("Parsing selected login method FAILED.", e); executionContext.put(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED, true); @@ -100,8 +107,15 @@ public class ReceiveOtherLoginMethodGuiResponseTask extends AbstractLocaleAuthSe return null; } - private void transitionToNextTask(ExecutionContext executionContext, SelectedLoginMethod selection) { + private void transitionToNextTask(ExecutionContext executionContext, SelectedLoginMethod selection, + HttpServletRequest request, HttpServletResponse response) throws TaskExecutionException { switch (selection) { + case STOP_MATCHING_PROCESS: + log.info("Matching process WAS stopped by entity. Stopping auth. process ... "); + MatchingTaskUtils.setMatchingState(pendingReq, MatchingStates.CANCELED_BY_USER); + stopProcessFromUserDecision(executionContext, request, response); + return; + case EIDAS_LOGIN: executionContext.put(Constants.TRANSITION_TO_GENERATE_EIDAS_LOGIN, true); return; @@ -111,9 +125,22 @@ public class ReceiveOtherLoginMethodGuiResponseTask extends AbstractLocaleAuthSe return; case NO_OTHER_LOGIN: + if (!authConfig.getBasicConfigurationBoolean(Constants.CONFIG_PROP_MATCHING_BY_ADDRESS)) { + log.error("Matching by address was requested but it's disabled by configuration!"); + throw new TaskExecutionException(pendingReq, + "Matching by address was requested but it's disabled by configuration!", + new EaafException("module.eidasauth.matching.98")); + + } + executionContext.put(Constants.TRANSITION_TO_GENERATE_GUI_QUERY_AUSTRIAN_RESIDENCE_TASK, true); return; + + case REQUESTING_NEW_ENTRY: + executionContext.put(Constants.TRANSITION_TO_REQUESTING_NEW_ERNP_ENTRY_TASK, true); + return; + case ADD_ME_AS_NEW: executionContext.put(Constants.TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_TASK, true); return; diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/utils/MatchingTaskUtils.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/utils/MatchingTaskUtils.java index c8a1f190..c350cb05 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/utils/MatchingTaskUtils.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/utils/MatchingTaskUtils.java @@ -15,6 +15,8 @@ import org.springframework.lang.NonNull; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import at.asitplus.eidas.specific.core.MsEidasNodeConstants; +import at.asitplus.eidas.specific.core.MsEidasNodeConstants.MatchingStates; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.MatchedPersonResult; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; @@ -27,7 +29,9 @@ import at.gv.egiz.eaaf.core.impl.idp.auth.data.AuthProcessDataWrapper; import eu.eidas.auth.commons.attribute.AttributeDefinition; import eu.eidas.auth.commons.attribute.AttributeValue; import eu.eidas.auth.commons.protocol.eidas.impl.PostalAddress; +import lombok.extern.slf4j.Slf4j; +@Slf4j public class MatchingTaskUtils { /** @@ -105,7 +109,6 @@ public class MatchingTaskUtils { * @param personInfos Person information after a successful match * @throws EaafStorageException In case of data can not be add into session */ - @Nullable public static void storeFinalMatchingResult(IRequest pendingReq, MatchedPersonResult personInfos) throws EaafStorageException { getAuthProcessDataWrapper(pendingReq).setGenericDataToSession( @@ -114,6 +117,23 @@ public class MatchingTaskUtils { } /** + * Store matching result-state. + * + * @param pendingReq Current pendingRequest + * @param state Operation that results into a person match + */ + public static void setMatchingState(IRequest pendingReq, MatchingStates state) { + try { + pendingReq.setRawDataToTransaction(MsEidasNodeConstants.DATA_MATCHING_STATE, state); + + } catch (EaafStorageException e) { + log.warn("Can NOT set matching-state for statistic logging.", e); + + } + } + + + /** * Get holder for authentication information for the current process. * * @param pendingReq Current pendingRequest 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 dfa8622c..e57f9ca6 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 @@ -45,6 +45,8 @@ from="receiveOtherLoginMethodGuiResponseTask" to="generateMobilePhoneSignatureRequestTask" /> <pd:Transition conditionExpression="ctx['TASK_GenerateAustrianResidenceGuiTask']" from="receiveOtherLoginMethodGuiResponseTask" to="generateAustrianResidenceGuiTask" /> + <pd:Transition conditionExpression="ctx['TASK_RequestingNewErnpEntryTask']" + from="receiveOtherLoginMethodGuiResponseTask" to="generateOtherLoginMethodGuiTask" /> <pd:Transition conditionExpression="ctx['TASK_CreateNewErnpEntryTask']" from="receiveOtherLoginMethodGuiResponseTask" to="createNewErnpEntryTask" /> diff --git a/modules/authmodule-eIDAS-v2/src/main/resources/messages/eidas_connector_message.properties b/modules/authmodule-eIDAS-v2/src/main/resources/messages/eidas_connector_message.properties index 6d73c43a..dafa7ce3 100644 --- a/modules/authmodule-eIDAS-v2/src/main/resources/messages/eidas_connector_message.properties +++ b/modules/authmodule-eIDAS-v2/src/main/resources/messages/eidas_connector_message.properties @@ -30,5 +30,6 @@ module.eidasauth.matching.24=Matching be using Austrian Identity not possible. U module.eidasauth.matching.25=Matching be using alternative eIDAS authentication not possible. Provide more or other data or use another method for matching. module.eidasauth.matching.26=Matching be using alternative eIDAS authentication not possible, because Name or Country not matched. Provide more or other data or use another method for matching. +module.eidasauth.matching.98=Matching failed, because a method was selected that was not allowed. module.eidasauth.matching.99=Matching failed, because of an unexpected processing error. Reason: {0} diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java index 496158fa..6d08a731 100644 --- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java +++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateOtherLoginMethodGuiTaskTest.java @@ -29,6 +29,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.json.JsonMapper; +import at.asitplus.eidas.specific.core.test.config.dummy.MsConnectorDummyConfigMap; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SelectedLoginMethod; import at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.GenerateOtherLoginMethodGuiTask; @@ -53,6 +54,8 @@ public class GenerateOtherLoginMethodGuiTaskTest { private static final String TEST_PATTER_REQ_PARAM = "<input type=\"hidden\" name=\"loginSelection\" value=\"{0}\">"; + @Autowired MsConnectorDummyConfigMap config; + @Autowired GenerateOtherLoginMethodGuiTask task; @@ -86,6 +89,9 @@ public class GenerateOtherLoginMethodGuiTaskTest { executionContext = new ExecutionContextImpl(); + config.putConfigValue("auth.eIDAS.matching.byaddress.enable", "false"); + + LocaleContextHolder.resetLocaleContext(); } @@ -172,6 +178,10 @@ public class GenerateOtherLoginMethodGuiTaskTest { assertNotNull("createNewErnpEntry", json.get(Constants.HTML_FORM_CREATE_NEW_ERNP_ENTRY)); assertFalse("createNewErnpEntry", json.get(Constants.HTML_FORM_CREATE_NEW_ERNP_ENTRY).asBoolean()); + assertNotNull("enableMatchingByAddressSearch", json.get(Constants.HTML_FORM_CREATE_NEW_ERNP_ENTRY)); + assertFalse("enableMatchingByAddressSearch", json.get(Constants.HTML_FORM_CREATE_NEW_ERNP_ENTRY).asBoolean()); + + assertNotNull("pendingRequest not stored", storage.getPendingRequest(pendingReq.getPendingRequestId())); @@ -199,10 +209,11 @@ public class GenerateOtherLoginMethodGuiTaskTest { @Test public void advancedMatchingFailedMsg() throws TaskExecutionException, UnsupportedEncodingException { executionContext.put(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED, true); - + config.putConfigValue("auth.eIDAS.matching.byaddress.enable", "true"); + task.execute(pendingReq, executionContext); - String html = doBasicValidation(); + String html = doBasicValidation(true); Assert.assertFalse("Missing eIDAS infos", html.contains(MessageFormat.format(TEST_PATTER_REQ_PARAM, SelectedLoginMethod.ADD_ME_AS_NEW))); Assert.assertTrue("missing errorfield", @@ -218,7 +229,7 @@ public class GenerateOtherLoginMethodGuiTaskTest { task.execute(pendingReq, executionContext); - String html = doBasicValidation(); + String html = doBasicValidation(false); Assert.assertTrue("missing errorfield", html.contains("<div id=\"matchingError\"")); Assert.assertTrue("missing errorfield", @@ -231,7 +242,7 @@ public class GenerateOtherLoginMethodGuiTaskTest { task.execute(pendingReq, executionContext); - doBasicValidation(); + doBasicValidation(false); } @@ -242,7 +253,7 @@ public class GenerateOtherLoginMethodGuiTaskTest { task.execute(pendingReq, executionContext); - doBasicValidation(); + doBasicValidation(false); } @@ -252,7 +263,7 @@ public class GenerateOtherLoginMethodGuiTaskTest { task.execute(pendingReq, executionContext); - doBasicValidation(); + doBasicValidation(false); } @@ -263,11 +274,11 @@ public class GenerateOtherLoginMethodGuiTaskTest { task.execute(pendingReq, executionContext); - doBasicValidation(); + doBasicValidation(false); } - private String doBasicValidation() throws UnsupportedEncodingException { + private String doBasicValidation(boolean addressSearchAllowed) throws UnsupportedEncodingException { Assert.assertEquals("Wrong http StatusCode", 200, httpResp.getStatus()); Assert.assertEquals("Wrong http ContentType", "text/html;charset=UTF-8", httpResp.getContentType()); @@ -278,7 +289,8 @@ public class GenerateOtherLoginMethodGuiTaskTest { Assert.assertTrue("Missing IDA Login", html.contains(MessageFormat.format(TEST_PATTER_REQ_PARAM, SelectedLoginMethod.MOBILE_PHONE_SIGNATURE_LOGIN))); Assert.assertTrue("Missing residence infos", - html.contains(MessageFormat.format(TEST_PATTER_REQ_PARAM, SelectedLoginMethod.NO_OTHER_LOGIN))); + html.contains(MessageFormat.format(TEST_PATTER_REQ_PARAM, + addressSearchAllowed ? SelectedLoginMethod.NO_OTHER_LOGIN : SelectedLoginMethod.REQUESTING_NEW_ENTRY))); Assert.assertTrue("Missing eIDAS infos", html.contains(MessageFormat.format(TEST_PATTER_REQ_PARAM, SelectedLoginMethod.EIDAS_LOGIN))); diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java index 750a17ce..66867fce 100644 --- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java +++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveOtherLoginMethodGuiResponseTaskTest.java @@ -4,6 +4,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; import org.apache.commons.lang3.RandomStringUtils; import org.junit.Before; @@ -21,9 +23,11 @@ import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; +import at.asitplus.eidas.specific.core.test.config.dummy.MsConnectorDummyConfigMap; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SelectedLoginMethod; import at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.ReceiveOtherLoginMethodGuiResponseTask; +import at.gv.egiz.eaaf.core.exceptions.EaafException; import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl; import at.gv.egiz.eaaf.core.impl.idp.process.ExecutionContextImpl; @@ -37,6 +41,8 @@ import at.gv.egiz.eaaf.core.impl.idp.process.ExecutionContextImpl; @WebAppConfiguration public class ReceiveOtherLoginMethodGuiResponseTaskTest { + @Autowired MsConnectorDummyConfigMap config; + @Autowired private ReceiveOtherLoginMethodGuiResponseTask task; @@ -68,10 +74,22 @@ public class ReceiveOtherLoginMethodGuiResponseTaskTest { pendingReq.setAuthUrl("https://localhost/ms_connector"); pendingReq.setPendingReqId(RandomStringUtils.randomAlphanumeric(10)); + config.putConfigValue("auth.eIDAS.matching.byaddress.enable", "false"); + LocaleContextHolder.resetLocaleContext(); } @Test + public void withStopMatchingSelection() throws TaskExecutionException { +httpReq.setParameter(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER, SelectedLoginMethod.STOP_MATCHING_PROCESS.name()); + + task.execute(pendingReq, executionContext); + + assertTrue("stoppedByUser", pendingReq.isAbortedByUser()); + + } + + @Test public void withMobileSignatureSelection() throws TaskExecutionException { testTransition(SelectedLoginMethod.MOBILE_PHONE_SIGNATURE_LOGIN, Constants.TRANSITION_TO_GENERATE_MOBILE_PHONE_SIGNATURE_REQUEST_TASK); assertEquals("return to selection", false, executionContext.get(Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK)); @@ -87,18 +105,40 @@ public class ReceiveOtherLoginMethodGuiResponseTaskTest { @Test public void withNoOtherLoginSelection() throws TaskExecutionException { + config.putConfigValue("auth.eIDAS.matching.byaddress.enable", "true"); + testTransition(SelectedLoginMethod.NO_OTHER_LOGIN, Constants.TRANSITION_TO_GENERATE_GUI_QUERY_AUSTRIAN_RESIDENCE_TASK); assertEquals("return to selection", false, executionContext.get(Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK)); } @Test + public void withNoOtherLoginSelectionDisabled() throws TaskExecutionException { + httpReq.setParameter(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER, SelectedLoginMethod.NO_OTHER_LOGIN.name()); + + TaskExecutionException error = assertThrows("wrong exception", TaskExecutionException.class, + () -> task.execute(pendingReq, executionContext)); + + assertEquals("wrong errorCode", "module.eidasauth.matching.98", + ((EaafException) error.getOriginalException()).getErrorId()); + + } + + @Test public void withAddMeAsNewSelection() throws TaskExecutionException { testTransition(SelectedLoginMethod.ADD_ME_AS_NEW, Constants.TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_TASK); assertEquals("return to selection", false, executionContext.get(Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK)); } + @Test + public void withRequestingNewEntrySelection() throws TaskExecutionException { + testTransition(SelectedLoginMethod.REQUESTING_NEW_ENTRY, Constants.TRANSITION_TO_REQUESTING_NEW_ERNP_ENTRY_TASK); + assertEquals("return to selection", true, executionContext.get(Constants.TRANSITION_TO_REQUESTING_NEW_ERNP_ENTRY_TASK)); + assertEquals("return to selection", false, executionContext.get(Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK)); + + } + public void testTransition(SelectedLoginMethod loginMethod, String expectedTransition) throws TaskExecutionException { httpReq.setParameter(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER, loginMethod.name()); executionContext.put(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED, true); @@ -109,6 +149,8 @@ public class ReceiveOtherLoginMethodGuiResponseTaskTest { assertFalse("wrong process-cancelled flag", executionContext.isProcessCancelled()); assertNotNull("no login-selection found", executionContext.get(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER)); assertEquals("Wrong login-selection found", loginMethod.name(), executionContext.get(Constants.REQ_SELECTED_LOGIN_METHOD_PARAMETER)); + + assertEquals("Next task", true, executionContext.get(expectedTransition)); assertNull("find advancedMatchingError flag", executionContext.get(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED)); diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/utils/AddressSearchResultTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/utils/AddressSearchResultTest.java new file mode 100644 index 00000000..fef157db --- /dev/null +++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/utils/AddressSearchResultTest.java @@ -0,0 +1,56 @@ +package at.asitplus.eidas.specific.modules.auth.eidas.v2.test.utils; + +import static org.junit.Assert.assertArrayEquals; + +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.BlockJUnit4ClassRunner; +import org.mockito.internal.util.collections.Sets; + +import at.asitplus.eidas.specific.modules.auth.eidas.v2.controller.AdresssucheController.AdresssucheOutput; + +@RunWith(BlockJUnit4ClassRunner.class) +public class AddressSearchResultTest { + + @Test + public void checkNumbers() { + + Set<AdresssucheOutput> result = Sets.newSet( + buildRandom("2"), + buildRandom("3"), + buildRandom("1"), + buildRandom("10"), + buildRandom(null), + buildRandom("10-12"), + buildRandom("15") + ); + + final List<String> sorted = result.stream().sorted().limit(30) + .map(el -> el.getNumber()) + .collect(Collectors.toList()); + + + assertArrayEquals("wrong order", + new Object[]{null, "1", "2", "3", "10", "15", "10-12"}, + sorted.toArray()); + + + + + } + + private AdresssucheOutput buildRandom(String number) { + return AdresssucheOutput.builder() + .municipality("aaaaaaaa") + .postleitzahl("8080") + .street("bbbbb") + .number(number) + .village("cccccc") + .build(); + } + +} diff --git a/modules/authmodule_id-austria/pom.xml b/modules/authmodule_id-austria/pom.xml index 19eddb73..9a77c787 100644 --- a/modules/authmodule_id-austria/pom.xml +++ b/modules/authmodule_id-austria/pom.xml @@ -3,7 +3,7 @@ <parent> <groupId>at.asitplus.eidas.ms_specific</groupId> <artifactId>modules</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <groupId>at.asitplus.eidas.ms_specific.modules</groupId> <artifactId>authmodule_id-austria</artifactId> diff --git a/modules/core_common_lib/pom.xml b/modules/core_common_lib/pom.xml index 413a201e..f3378b17 100644 --- a/modules/core_common_lib/pom.xml +++ b/modules/core_common_lib/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>at.asitplus.eidas.ms_specific</groupId> <artifactId>modules</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <artifactId>core_common_lib</artifactId> <name>ms_specific_common_lib</name> diff --git a/modules/core_common_lib/src/main/java/at/asitplus/eidas/specific/core/MsEidasNodeConstants.java b/modules/core_common_lib/src/main/java/at/asitplus/eidas/specific/core/MsEidasNodeConstants.java index 8da7ddd0..68ef4560 100644 --- a/modules/core_common_lib/src/main/java/at/asitplus/eidas/specific/core/MsEidasNodeConstants.java +++ b/modules/core_common_lib/src/main/java/at/asitplus/eidas/specific/core/MsEidasNodeConstants.java @@ -183,6 +183,9 @@ public class MsEidasNodeConstants { public static final String DATA_REQUESTED_LOA_LIST = "req_requestedLoA"; public static final String DATA_REQUESTED_LOA_COMPERISON = "req_requestedLoAComperision"; + + public static final String DATA_MATCHING_STATE = "process_matchingstate"; + public static final List<String> COUNTRY_SELECTION_PARAM_WHITELIST = Arrays.asList(REQ_PARAM_SELECTED_COUNTRY, REQ_PARAM_SELECTED_ENVIRONMENT); @@ -224,6 +227,16 @@ public class MsEidasNodeConstants { }); + public enum MatchingStates { + NO_REQUIRED, + CANCELED_BY_USER, + BY_PERSONALID, + BY_COUNTRY_SPECIFIC, + BY_ID_AUSTRIA, + BY_EIDAS, + BY_ADDRESS, + BY_NEW_ERNP_ENTRY } + private MsEidasNodeConstants() { //hidden Constructor for class with static values only. } diff --git a/modules/core_common_webapp/pom.xml b/modules/core_common_webapp/pom.xml index c780a367..5f61003f 100644 --- a/modules/core_common_webapp/pom.xml +++ b/modules/core_common_webapp/pom.xml @@ -3,7 +3,7 @@ <parent> <groupId>at.asitplus.eidas.ms_specific</groupId> <artifactId>modules</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <artifactId>core_common_webapp</artifactId> <name>WebApplication commons</name> diff --git a/modules/core_common_webapp/src/main/java/at/asitplus/eidas/specific/core/logger/StatisticLogger.java b/modules/core_common_webapp/src/main/java/at/asitplus/eidas/specific/core/logger/StatisticLogger.java index bdaf83f6..22cace10 100644 --- a/modules/core_common_webapp/src/main/java/at/asitplus/eidas/specific/core/logger/StatisticLogger.java +++ b/modules/core_common_webapp/src/main/java/at/asitplus/eidas/specific/core/logger/StatisticLogger.java @@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory; import at.asitplus.eidas.specific.core.MsEidasNodeConstants; import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.IStatusMessenger; import at.gv.egiz.eaaf.core.api.idp.IAuthData; import at.gv.egiz.eaaf.core.api.logging.IStatisticLogger; import at.gv.egiz.eaaf.core.exceptions.EaafException; @@ -50,6 +51,7 @@ public class StatisticLogger implements IStatisticLogger { protocolRequest.getRawData(MsEidasNodeConstants.DATA_REQUESTERID), protocolRequest.getServiceProviderConfiguration().getAreaSpecificTargetIdentifier(), authData.getCiticenCountryCode(), + extractMatchingState(protocolRequest.getRawData(MsEidasNodeConstants.DATA_MATCHING_STATE)), STATUS_SUCCESS, StringUtils.EMPTY, StringUtils.EMPTY)); @@ -58,7 +60,7 @@ public class StatisticLogger implements IStatisticLogger { @Override public void logErrorOperation(Throwable throwable) { - String errorId = "TODO"; + String errorId = IStatusMessenger.CODES_INTERNAL_ERROR_GENERIC; if (throwable instanceof EaafException) { errorId = ((EaafException) throwable).getErrorId(); } @@ -69,6 +71,7 @@ public class StatisticLogger implements IStatisticLogger { StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, + StringUtils.EMPTY, STATUS_ERROR, errorId, throwable.getMessage())); @@ -89,6 +92,7 @@ public class StatisticLogger implements IStatisticLogger { errorRequest.getRawData(MsEidasNodeConstants.DATA_REQUESTERID), errorRequest.getServiceProviderConfiguration().getAreaSpecificTargetIdentifier(), StringUtils.EMPTY, + extractMatchingState(errorRequest.getRawData(MsEidasNodeConstants.DATA_MATCHING_STATE)), STATUS_ERROR, errorId, throwable.getMessage())); @@ -99,6 +103,7 @@ public class StatisticLogger implements IStatisticLogger { StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, + StringUtils.EMPTY, STATUS_ERROR, errorId, throwable.getMessage())); @@ -112,8 +117,13 @@ public class StatisticLogger implements IStatisticLogger { } + private String extractMatchingState(Object state) { + return state != null ? state.toString() : MsEidasNodeConstants.MatchingStates.NO_REQUIRED.toString(); + + } + private String buildLogMessage(String transId, String entityId, Object requesterId, String target, - String cc, + String cc, String matchingState, String status, String errorCode, String errorMsg) { String logMsg = StringUtils.EMPTY; @@ -131,7 +141,9 @@ public class StatisticLogger implements IStatisticLogger { logMsg += target + ","; logMsg += cc + ","; - + + logMsg += matchingState + ","; + logMsg += status + ","; logMsg += errorCode + ","; logMsg += errorMsg; diff --git a/modules/core_commons_eidas/pom.xml b/modules/core_commons_eidas/pom.xml index 2a1e2575..2b2503d8 100644 --- a/modules/core_commons_eidas/pom.xml +++ b/modules/core_commons_eidas/pom.xml @@ -3,7 +3,7 @@ <parent> <groupId>at.asitplus.eidas.ms_specific</groupId> <artifactId>modules</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <artifactId>core_commons_eidas</artifactId> <name>Commons for eIDAS Node communication</name> diff --git a/modules/eidas_proxy-sevice/pom.xml b/modules/eidas_proxy-sevice/pom.xml index 4a4ea26f..f2b6f840 100644 --- a/modules/eidas_proxy-sevice/pom.xml +++ b/modules/eidas_proxy-sevice/pom.xml @@ -3,7 +3,7 @@ <parent> <groupId>at.asitplus.eidas.ms_specific</groupId> <artifactId>modules</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <groupId>at.asitplus.eidas.ms_specific.modules</groupId> <artifactId>eidas_proxy-sevice</artifactId> diff --git a/modules/pom.xml b/modules/pom.xml index 58d71cab..baec271d 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>at.asitplus.eidas</groupId> <artifactId>ms_specific</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <groupId>at.asitplus.eidas.ms_specific</groupId> <artifactId>modules</artifactId> diff --git a/ms_specific_connector/pom.xml b/ms_specific_connector/pom.xml index 9aca807b..c888c586 100644 --- a/ms_specific_connector/pom.xml +++ b/ms_specific_connector/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>at.asitplus.eidas</groupId> <artifactId>ms_specific</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <groupId>at.asitplus.eidas.ms_specific</groupId> diff --git a/ms_specific_connector/src/main/resources/application.properties b/ms_specific_connector/src/main/resources/application.properties index 700f4d74..660e8099 100644 --- a/ms_specific_connector/src/main/resources/application.properties +++ b/ms_specific_connector/src/main/resources/application.properties @@ -130,6 +130,9 @@ eidas.ms.auth.eIDAS.szrclient.eidasbind.mds.inject=false #### matching###### +eidas.ms.auth.eIDAS.matching.byaddress.enable=true +eidas.ms.auth.eIDAS.matching.byaddress.maxresults=250 + # ZMR communication #eidas.ms.auth.eIDAS.zmrclient.endpoint=http://localhost:1234/demozmr #eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.type=jks diff --git a/ms_specific_connector/src/main/resources/properties/messages.properties b/ms_specific_connector/src/main/resources/properties/messages.properties index a2aaf95d..cc60cd6e 100644 --- a/ms_specific_connector/src/main/resources/properties/messages.properties +++ b/ms_specific_connector/src/main/resources/properties/messages.properties @@ -47,11 +47,8 @@ gui.countryselection.country.is=Iceland gui.countryselection.country.is.logo.alt=Iceland-eID gui.countryselection.country.it=Italy gui.countryselection.country.it.logo.alt=Italy-eID -<<<<<<< HEAD gui.countryselection.country.li=Lichtenstein gui.countryselection.country.li.logo.alt=Lichtensteinische-eID -======= ->>>>>>> 1ad67c91820de1c7f2b2541f8e39752baac197d2 gui.countryselection.country.lt=Lithuania gui.countryselection.country.lt.logo.alt=Lithuania-eID gui.countryselection.country.lv=Latvia diff --git a/ms_specific_connector/src/main/resources/properties/messages_de.properties b/ms_specific_connector/src/main/resources/properties/messages_de.properties index 187b7b37..6f470ea0 100644 --- a/ms_specific_connector/src/main/resources/properties/messages_de.properties +++ b/ms_specific_connector/src/main/resources/properties/messages_de.properties @@ -48,11 +48,8 @@ gui.countryselection.country.is=Island gui.countryselection.country.is.logo.alt=Isländische-eID gui.countryselection.country.it=Italien gui.countryselection.country.it.logo.alt=Italienische-eID -<<<<<<< HEAD gui.countryselection.country.li=Lichtenstein gui.countryselection.country.li.logo.alt=Lichtensteinische-eID -======= ->>>>>>> 1ad67c91820de1c7f2b2541f8e39752baac197d2 gui.countryselection.country.lt=Litauen gui.countryselection.country.lt.logo.alt=Litauische-eID gui.countryselection.country.lv=Lettland diff --git a/ms_specific_proxyservice/pom.xml b/ms_specific_proxyservice/pom.xml index 16f25bf2..ef347bae 100644 --- a/ms_specific_proxyservice/pom.xml +++ b/ms_specific_proxyservice/pom.xml @@ -3,7 +3,7 @@ <parent> <groupId>at.asitplus.eidas</groupId> <artifactId>ms_specific</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <groupId>at.asitplus.eidas.ms_specific</groupId> <artifactId>ms_specific_proxyservice</artifactId> @@ -5,7 +5,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>at.asitplus.eidas</groupId> <artifactId>ms_specific</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> <packaging>pom</packaging> <name>MS specific eIDAS components</name> |