aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-03-17 11:35:05 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-03-17 11:35:05 +0100
commita442134f88a2e766ea6fdce9b80075c5a9a8b420 (patch)
tree84c1313101b9a2e3cd983f9712228005309f9f0a /id/server/idserverlib/src/main/java
parent7e97168c78032a3bd2680251ca11cd4bf1219e81 (diff)
downloadmoa-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/server/idserverlib/src/main/java')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java37
1 files changed, 28 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.");