ozeigermann 2005/02/09 09:56:13
Modified: wck/src/org/apache/slide/simple/authentication
JAASLoginModule.java
Log:
Replaced exceptions on failed login with simple return of false.
Before this every login failure and empty user name created a stack
trace which made this simple failure look like a sever error
Revision Changes Path
1.2 +12 -6
jakarta-slide/wck/src/org/apache/slide/simple/authentication/JAASLoginModule.java
Index: JAASLoginModule.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/wck/src/org/apache/slide/simple/authentication/JAASLoginModule.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JAASLoginModule.java 9 Dec 2004 12:17:09 -0000 1.1
+++ JAASLoginModule.java 9 Feb 2005 17:56:13 -0000 1.2
@@ -141,10 +141,14 @@
final char[] password = ((PasswordCallback)
callbacks[1]).getPassword();
if (username == null) {
- throw new LoginException("No user name entered");
+ Domain.warn("No user name entered");
+ return false;
+// throw new LoginException("No user name entered");
}
if (password == null) {
- throw new LoginException("No password entered");
+ Domain.warn("No password entered");
+ return false;
+// throw new LoginException("No password entered");
}
// share username and password with other LoginModules
@@ -155,7 +159,9 @@
try {
conn = factory.getAuthenticationSession(username, new
String(password));
if (conn == null) {
- throw new LoginException("Could not authenticate");
+ Domain.warn("Could not authenticate user " + username);
+ return false;
+// throw new LoginException("Could not authenticate");
}
} catch (Exception e) {
throw new LoginException("Could not create session: " +
e.getMessage());
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]