diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2014-03-17 11:35:05 +0100 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2014-03-17 11:35:05 +0100 |
commit | a442134f88a2e766ea6fdce9b80075c5a9a8b420 (patch) | |
tree | 84c1313101b9a2e3cd983f9712228005309f9f0a /id | |
parent | 7e97168c78032a3bd2680251ca11cd4bf1219e81 (diff) | |
download | moa-id-spss-a442134f88a2e766ea6fdce9b80075c5a9a8b420.tar.gz moa-id-spss-a442134f88a2e766ea6fdce9b80075c5a9a8b420.tar.bz2 moa-id-spss-a442134f88a2e766ea6fdce9b80075c5a9a8b420.zip |
add additonal STORK error messages
Diffstat (limited to 'id')
2 files changed, 29 insertions, 9 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index fd47c5f53..766f6e984 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -1714,7 +1714,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws SZRGWClientException */ - public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String gender, String citizenSignature, String represented, String representative, String mandateContent, String organizationAddress, String organizationType, String targetType, String targetValue, String oaFriendlyName, String filters) throws SZRGWClientException { + public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String gender, String citizenSignature, String represented, String representative, String mandateContent, String organizationAddress, String organizationType, String targetType, String targetValue, String oaFriendlyName, List<String> filters) throws SZRGWClientException { try { AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); @@ -1751,7 +1751,9 @@ public class AuthenticationServer implements MOAIDAuthConstants { Filters filterObject = new Filters(); MandateIdentifiers mandateIds = new MandateIdentifiers(); - for(String current : filters.split(",")) + + //TODO! + for(String current : filters) mandateIds.getMandateIdentifier().add(current.trim()); filterObject.setMandateIdentifiers(mandateIds); mis.setFilters(filterObject); @@ -1815,7 +1817,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { */ public CreateIdentityLinkResponse getIdentityLink(String citizenSignature, String representative, String represented, String mandateContent, - String organizationAddress, String organizationType, String targetType, String targetValue, String oaFriendlyName, String filters) throws SZRGWClientException { + String organizationAddress, String organizationType, String targetType, String targetValue, String oaFriendlyName, List<String> filters) throws SZRGWClientException { return getIdentityLink(null, null, null, null, null, citizenSignature, represented, representative, mandateContent, organizationAddress, organizationType, targetType, targetValue, oaFriendlyName, filters); @@ -1838,7 +1840,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { public CreateIdentityLinkResponse getIdentityLink(String eIdentifier, String givenName, String lastName, String dateOfBirth, String gender, String citizenSignature, String representative, String represented, - String mandate, String targetType, String targetValue, String oaFriendlyName, String filters) throws SZRGWClientException { + String mandate, String targetType, String targetValue, String oaFriendlyName, List<String> filters) throws SZRGWClientException { return getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, gender, citizenSignature, representative, represented, mandate, null, null, targetType, targetValue, oaFriendlyName, filters); @@ -1959,12 +1961,27 @@ public class AuthenticationServer implements MOAIDAuthConstants { Logger.debug("STORK AuthnRequest succesfully assembled."); - STORKSAMLEngine samlEngine = STORKSAMLEngine.getInstance("outgoing"); + STORKSAMLEngine samlEngine = null; + + try { + samlEngine = STORKSAMLEngine.getInstance("outgoing"); + + } catch (Exception e) { + Logger.error("STORK engine initialization FAILED with error " + + e.getLocalizedMessage(), e); + throw new MOAIDException("stork.11", null, e); + + } + if (samlEngine == null) + throw new MOAIDException("stork.11", null); + + try { authnRequest = samlEngine.generateSTORKAuthnRequest(authnRequest); - } catch (STORKSAMLEngineException e) { + + } catch (Exception e ) { Logger.error("Could not sign STORK SAML AuthnRequest.", e); - throw new MOAIDException("stork.00", null); + throw new MOAIDException("stork.00", null, e); } Logger.info("STORK AuthnRequest successfully signed!"); @@ -1972,10 +1989,12 @@ public class AuthenticationServer implements MOAIDAuthConstants { //validate AuthnRequest try { samlEngine.validateSTORKAuthnRequest(authnRequest.getTokenSaml()); - } catch (STORKSAMLEngineException e) { + + } catch (Exception e) { Logger.error("STORK SAML AuthnRequest not valid.", e); throw new MOAIDException("stork.01", null); - } + + } Logger.debug("STORK AuthnRequest successfully internally validated."); diff --git a/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties b/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties index 2559d3d18..ec787d745 100644 --- a/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties +++ b/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties @@ -205,6 +205,7 @@ stork.07=Es existiert kein STORK AuthnRequest f\u00FCr diese STORK Response stork.08=STORK SAML Assertion Validierung fehlgeschlagen
stork.09=Fehler beim \u00FCberpr\u00FCfen der STORK B\u00FCrgerInnen Signatur
stork.10=Fehler in der Verbindung zum SZR-Gateway
+stork.11=STORK-SAML Engine konnte nicht initialisiert werden.
pvp2.00={0} ist kein gueltiger consumer service index
pvp2.01=Fehler beim kodieren der PVP2 Antwort
|