changeset 4492:439913782777

Merged
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 14 Nov 2012 10:53:15 +0100
parents 302f5da348bb (current diff) 82cc03e5f1c4 (diff)
children b15f82f0d652
files
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);
         }
     }
--- 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

http://dive4elements.wald.intevation.org