From cfbd74f21130b97c0ae20c63ce4d7c4429c1e78b Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 26 Feb 2015 08:52:59 +0100 Subject: Fix errorhandling in STORK 2 PepsConnectorTask --- .../moa/id/auth/modules/stork/tasks/PepsConnectorTask.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'id/server/modules/module-stork/src/main') 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( -- cgit v1.2.3