diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2014-07-08 09:38:37 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2014-07-08 09:38:37 +0200 |
commit | 45727ed45e3deec0fff835a26f9b87adcfd0c6ba (patch) | |
tree | b10fb1385e09eee6d312bfb9f17c37c11ab38274 /id | |
parent | 85d5d9885979ca298f3d83699a07f7c5c234bec7 (diff) | |
download | moa-id-spss-45727ed45e3deec0fff835a26f9b87adcfd0c6ba.tar.gz moa-id-spss-45727ed45e3deec0fff835a26f9b87adcfd0c6ba.tar.bz2 moa-id-spss-45727ed45e3deec0fff835a26f9b87adcfd0c6ba.zip |
fix exception if attribute is not provided
Diffstat (limited to 'id')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index 2c8b44404..2f1e50a05 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -136,8 +136,10 @@ public class STORKResponseProcessor { Logger.trace("Starting call...");
// if there is no signedDoc attribute, we cannot go on
+ String fiscalNumber = null;
String citizenSignature = getAttributeValue("signedDoc", attributeList);
- String fiscalNumber = getAttributeValue("fiscalNumber", attributeList);
+ if (hasAttribute("fiscalNumber", attributeList))
+ fiscalNumber = getAttributeValue("fiscalNumber", attributeList);
// if we have a signedDoc we test for a representation case
// - according to stork samlengine and commons
@@ -156,14 +158,15 @@ public class STORKResponseProcessor { String eIdentifier = getAttributeValue("eIdentifier", attributeList);
String givenName = getAttributeValue("givenName", attributeList);
String lastName = getAttributeValue("surname", attributeList);
- String dateOfBirth = getAttributeValue("dateOfBirth", attributeList);
+ String dateOfBirth = null;
+ if (hasAttribute("dateOfBirth", attributeList)) {
+ dateOfBirth = getAttributeValue("dateOfBirth", attributeList);
+ dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth);
+ }
// gender attribute is mandatory here because of some legal stuff
String gender = getAttributeValue("gender", attributeList);
- if (!StringUtils.isEmpty(dateOfBirth))
- dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth);
-
identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier,
givenName, lastName, dateOfBirth, gender, citizenSignature, null,
null, mandate, targetType, targetValue, oaFriendlyName, filters, fiscalNumber);
@@ -187,14 +190,15 @@ public class STORKResponseProcessor { String eIdentifier = getAttributeValue("eIdentifier", attributeList);
String givenName = getAttributeValue("givenName", attributeList);
String lastName = getAttributeValue("surname", attributeList);
- String dateOfBirth = getAttributeValue("dateOfBirth", attributeList);
+ String dateOfBirth = null;
+ if (hasAttribute("dateOfBirth", attributeList)) {
+ dateOfBirth = getAttributeValue("dateOfBirth", attributeList);
+ dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth);
+ }
// gender attribute is mandatory here because of some legal stuff
String gender = getAttributeValue("gender", attributeList);
-
- if (!StringUtils.isEmpty(dateOfBirth))
- dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth);
-
+
identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier,
givenName, lastName, dateOfBirth, gender, citizenSignature, representative,
represented, mandate, targetType, targetValue, oaFriendlyName, filters, fiscalNumber);
@@ -204,9 +208,11 @@ public class STORKResponseProcessor { String eIdentifier = getAttributeValue("eIdentifier", attributeList);
String givenName = getAttributeValue("givenName", attributeList);
String lastName = getAttributeValue("surname", attributeList);
- String dateOfBirth = getAttributeValue("dateOfBirth", attributeList);
- if (!StringUtils.isEmpty(dateOfBirth))
+ String dateOfBirth = null;
+ if (hasAttribute("dateOfBirth", attributeList)) {
+ dateOfBirth = getAttributeValue("dateOfBirth", attributeList);
dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth);
+ }
identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, fiscalNumber);
}
|