You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2004/03/15 23:25:35 UTC
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator FormAuthenticator.java LocalStrings.properties
markt 2004/03/15 14:25:35
Modified: catalina/src/share/org/apache/catalina/authenticator
FormAuthenticator.java LocalStrings.properties
Log:
Fix bug18005. Provide a better error message if session expires during login process.
Need translations for new error string.
Ported from TC4.
Revision Changes Path
1.8 +12 -3 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator/FormAuthenticator.java
Index: FormAuthenticator.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator/FormAuthenticator.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FormAuthenticator.java 27 Feb 2004 14:58:41 -0000 1.7
+++ FormAuthenticator.java 15 Mar 2004 22:25:35 -0000 1.8
@@ -237,11 +237,20 @@
return (false);
}
- // Save the authenticated Principal in our session
if (log.isDebugEnabled())
log.debug("Authentication of '" + username + "' was successful");
+
if (session == null)
- session = getSession(request, true);
+ session = getSession(request, false);
+ if (session == null) {
+ if (debug >=1)
+ log("User took so long to log on the session expired");
+ hres.sendError(HttpServletResponse.SC_REQUEST_TIMEOUT,
+ sm.getString("authenticator.sessionExpired"));
+ return (false);
+ }
+
+ // Save the authenticated Principal in our session
session.setNote(Constants.FORM_PRINCIPAL_NOTE, principal);
// If we are not caching, save the username and password as well
1.2 +1 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator/LocalStrings.properties
Index: LocalStrings.properties
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator/LocalStrings.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LocalStrings.properties 18 Jul 2002 16:48:02 -0000 1.1
+++ LocalStrings.properties 15 Mar 2004 22:25:35 -0000 1.2
@@ -8,5 +8,6 @@
authenticator.notAuthenticated=Configuration error: Cannot perform access control without an authenticated principal
authenticator.notContext=Configuration error: Must be attached to a Context
authenticator.notStarted=Security Interceptor has not yet been started
+authenticator.sessionExpired=The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser
authenticator.unauthorized=Cannot authenticate with the provided credentials
authenticator.userDataConstraint=This request violates a User Data constraint for this application
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org