# HG changeset patch # User Sascha L. Teichmann # Date 1342187518 0 # Node ID 1f64ee424f92d128b8477a5a8aad559dfde70d1f # Parent 06d999e95615f2a42c2637735f787a9f972219f4 Corrected broken web.xml flys-client/trunk@4996 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 06d999e95615 -r 1f64ee424f92 flys-client/ChangeLog --- a/flys-client/ChangeLog Fri Jul 13 13:38:32 2012 +0000 +++ b/flys-client/ChangeLog Fri Jul 13 13:51:58 2012 +0000 @@ -1,3 +1,15 @@ +2012-07-13 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/web.xml: Separate two context params correctly. + + * src/main/java/de/intevation/flys/client/server/auth/was/ServiceException.java, + src/main/java/de/intevation/flys/client/server/auth/AuthenticationException.java: + Removed imports. + + * src/main/java/de/intevation/flys/client/server/auth/plain/Authenticator.java, + src/main/java/de/intevation/flys/client/server/auth/AuthenticationFactory.java: + Added debug output. + 2012-07-13 Björn Ricks * src/main/java/de/intevation/flys/client/server/LoginServlet.java, diff -r 06d999e95615 -r 1f64ee424f92 flys-client/src/main/java/de/intevation/flys/client/server/auth/AuthenticationException.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/auth/AuthenticationException.java Fri Jul 13 13:38:32 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/auth/AuthenticationException.java Fri Jul 13 13:51:58 2012 +0000 @@ -1,7 +1,5 @@ package de.intevation.flys.client.server.auth; -import java.lang.Exception; - /** * Base class for Authentication related Exceptions */ diff -r 06d999e95615 -r 1f64ee424f92 flys-client/src/main/java/de/intevation/flys/client/server/auth/AuthenticationFactory.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/auth/AuthenticationFactory.java Fri Jul 13 13:38:32 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/auth/AuthenticationFactory.java Fri Jul 13 13:51:58 2012 +0000 @@ -1,18 +1,23 @@ package de.intevation.flys.client.server.auth; -import java.lang.IllegalArgumentException; +import org.apache.log4j.Logger; public class AuthenticationFactory { + private static final Logger log = + Logger.getLogger(AuthenticationFactory.class); + public static Authenticator getInstance(String name) throws IllegalArgumentException { if (name == null || name.equalsIgnoreCase("was") || name.equalsIgnoreCase("ggina")) { + log.debug("Using GGinA authenticator."); return new de.intevation.flys.client.server.auth.was.Authenticator(); } if (name.equalsIgnoreCase("plain")) { + log.debug("Using plain authenticator."); return new de.intevation.flys.client.server.auth.plain.Authenticator(); } diff -r 06d999e95615 -r 1f64ee424f92 flys-client/src/main/java/de/intevation/flys/client/server/auth/plain/Authenticator.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/auth/plain/Authenticator.java Fri Jul 13 13:38:32 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/auth/plain/Authenticator.java Fri Jul 13 13:51:58 2012 +0000 @@ -12,9 +12,14 @@ import java.util.ArrayList; import java.util.List; +import org.apache.log4j.Logger; + public class Authenticator implements de.intevation.flys.client.server.auth.Authenticator { + private static final Logger log = + Logger.getLogger(Authenticator.class); + public static class Authentication implements de.intevation.flys.client.server.auth.Authentication { @@ -71,6 +76,7 @@ { File file = credentialsFile(); if (!file.canRead() || !file.isFile()) { + log.error("cannot find user file '" + file + "'"); return new Authentication(null, null, new ArrayList(0)); } @@ -89,6 +95,7 @@ continue; } if (parts[0].equals(username)) { + log.debug("user '" + username + "' found."); if (parts[1].equals(password)) { List roles = new ArrayList(parts.length - 2); @@ -97,6 +104,7 @@ roles.add(parts[i]); } + log.debug("success"); return new Authentication(username, password, roles); } // Stop: user found, wrong password @@ -107,6 +115,7 @@ finally { reader.close(); } + log.debug("failed"); return new Authentication(null, null, new ArrayList(0)); } } diff -r 06d999e95615 -r 1f64ee424f92 flys-client/src/main/java/de/intevation/flys/client/server/auth/was/ServiceException.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/auth/was/ServiceException.java Fri Jul 13 13:38:32 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/auth/was/ServiceException.java Fri Jul 13 13:51:58 2012 +0000 @@ -1,7 +1,5 @@ package de.intevation.flys.client.server.auth.was; -import java.lang.Exception; - import de.intevation.flys.client.server.auth.AuthenticationException; public class ServiceException extends AuthenticationException { diff -r 06d999e95615 -r 1f64ee424f92 flys-client/src/main/webapp/WEB-INF/web.xml --- a/flys-client/src/main/webapp/WEB-INF/web.xml Fri Jul 13 13:38:32 2012 +0000 +++ b/flys-client/src/main/webapp/WEB-INF/web.xml Fri Jul 13 13:51:58 2012 +0000 @@ -8,6 +8,9 @@ server-url http://localhost:8181 + + + authentication GGInA