[Dive4elements-commits] [PATCH 2 of 2] Merged
Wald Commits
scm-commit at wald.intevation.org
Wed Nov 14 10:53:20 CET 2012
# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1352886795 -3600
# Node ID 439913782777b165a35ccb6ea460de79c6e64fd1
# Parent 302f5da348bb9c36f2bac555b058b3bf7f1adff0
# Parent 82cc03e5f1c43de8cd8c64e3cc9724efc59948a0
Merged
diff -r 302f5da348bb -r 439913782777 flys-client/src/main/java/de/intevation/flys/client/server/LoginServlet.java
--- a/flys-client/src/main/java/de/intevation/flys/client/server/LoginServlet.java Wed Nov 14 10:51:21 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/LoginServlet.java Wed Nov 14 10:53:15 2012 +0100
@@ -80,6 +80,7 @@
if (aresp == null || !aresp.isSuccess()) {
logger.debug("Authentication not successful");
this.redirectFailure(resp, req.getContextPath());
+ return;
}
User user = aresp.getUser();
@@ -90,6 +91,7 @@
if (!client.createUser(user)) {
this.redirectFailure(resp, req.getContextPath(),
"Could not create new user");
+ return;
}
}
@@ -101,7 +103,7 @@
this.redirectSuccess(resp, req.getContextPath(), uri);
}
catch(AuthenticationException e) {
- logger.error(e);
+ logger.error(e, e);
this.redirectFailure(resp, req.getContextPath(), e);
}
}
diff -r 302f5da348bb -r 439913782777 flys-client/src/main/java/de/intevation/flys/client/server/auth/was/Authenticator.java
--- a/flys-client/src/main/java/de/intevation/flys/client/server/auth/was/Authenticator.java Wed Nov 14 10:51:21 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/auth/was/Authenticator.java Wed Nov 14 10:53:15 2012 +0100
@@ -5,6 +5,7 @@
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
+import org.apache.http.StatusLine;
import org.apache.http.client.HttpClient;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.ssl.SSLSocketFactory;
@@ -39,6 +40,12 @@
Request httpget = new Request("https://geoportal.bafg.de/" +
"administration/WAS", username, password, encoding);
HttpResponse response = httpclient.execute(httpget);
+ StatusLine stline = response.getStatusLine();
+ if (stline.getStatusCode() != 200) {
+ throw new AuthenticationException("GGInA Server Error. " +
+ "Statuscode: " + stline.getStatusCode() +
+ ". Reason: " + stline.getReasonPhrase());
+ }
HttpEntity entity = response.getEntity();
if (entity == null) {
//FIXME throw AuthenticationException
More information about the Dive4elements-commits
mailing list