aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2015-02-26 08:52:59 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2015-02-26 08:52:59 +0100
commitcfbd74f21130b97c0ae20c63ce4d7c4429c1e78b (patch)
treeacc7fa7600df79f21a143e759dfb786ff714e658 /id
parentd534f989b469810596fa4a18d64de240377bdfe1 (diff)
downloadmoa-id-spss-cfbd74f21130b97c0ae20c63ce4d7c4429c1e78b.tar.gz
moa-id-spss-cfbd74f21130b97c0ae20c63ce4d7c4429c1e78b.tar.bz2
moa-id-spss-cfbd74f21130b97c0ae20c63ce4d7c4429c1e78b.zip
Fix errorhandling in STORK 2 PepsConnectorTask
Diffstat (limited to 'id')
-rw-r--r--id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java
index 1a18f8198..59f54f957 100644
--- a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java
+++ b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java
@@ -319,8 +319,18 @@ public class PepsConnectorTask extends AbstractAuthServletTask {
// extract signed doc element and citizen signature
String citizenSignature = null;
try {
- String signatureInfo = authnResponse.getPersonalAttributeList().get("signedDoc").getValue().get(0); // TODO ERROR HANDLING
+ if (authnResponse.getPersonalAttributeList().get("signedDoc") == null
+ || authnResponse.getPersonalAttributeList().get("signedDoc").getValue() == null
+ || authnResponse.getPersonalAttributeList().get("signedDoc").getValue().get(0) == null) {
+ Logger.info("STORK Response include NO signedDoc attribute!");
+ throw new STORKException("STORK Response include NO signedDoc attribute.");
+
+ }
+
+ String signatureInfo = authnResponse.getPersonalAttributeList().get("signedDoc").getValue().get(0);
+
+
Logger.debug("signatureInfo:" + signatureInfo);
SignResponse dssSignResponse = (SignResponse) ApiUtils.unmarshal(new StreamSource(