summaryrefslogtreecommitdiffstats
path: root/src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticator.java
diff options
context:
space:
mode:
authorSimon Rettberg2019-09-20 12:38:26 +0200
committerSimon Rettberg2019-09-20 12:38:26 +0200
commitaec1b5913057d515d90a5f1a63ebdb763bd3065d (patch)
tree57678ca3a99d69dea44adfdc7d7e3dfe1c4c8373 /src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticator.java
parentLog XML reply if failed to parse (diff)
downloadecp-client-lean-aec1b5913057d515d90a5f1a63ebdb763bd3065d.tar.gz
ecp-client-lean-aec1b5913057d515d90a5f1a63ebdb763bd3065d.tar.xz
ecp-client-lean-aec1b5913057d515d90a5f1a63ebdb763bd3065d.zip
Support retrying authentication without an @... suffix automatically
Diffstat (limited to 'src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticator.java')
-rw-r--r--src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticator.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticator.java b/src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticator.java
index b727fea..089bc88 100644
--- a/src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticator.java
+++ b/src/main/java/edu/kit/scc/dei/ecplean/ECPAuthenticator.java
@@ -67,7 +67,7 @@ public class ECPAuthenticator extends ECPAuthenticatorBase {
try {
initResponse = buildDocumentFromString(responseBody);
} catch (IOException | SAXException | ParserConfigurationException e) {
- logger.debug("Parsing SP Request failed");
+ logger.debug("Parsing SP Response failed");
throw new ECPAuthenticationException(e);
}
@@ -90,8 +90,19 @@ public class ECPAuthenticator extends ECPAuthenticatorBase {
Node firstChild = initResponse.getDocumentElement().getFirstChild();
initResponse.getDocumentElement().removeChild(firstChild);
-
- Document idpResponse = authenticateIdP(initResponse);
+
+ Document idpResponse;
+ try {
+ idpResponse = authenticateIdP(initResponse);
+ } catch (ECPAuthenticationException e) {
+ logger.debug("Original SP response:\n" + responseBody);
+ try {
+ logger.debug("Sent to IdP:\n" + documentToString(initResponse));
+ } catch (TransformerException e1) {
+ logger.debug("Barf", e1);
+ }
+ throw e;
+ }
String statusCode = getStatusCode(idpResponse);