tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1689075 - in /tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules: FormAuthModule.java TomcatAuthModule.java
Date Fri, 03 Jul 2015 19:57:38 GMT
Author: markt
Date: Fri Jul  3 19:57:38 2015
New Revision: 1689075

URL: http://svn.apache.org/r1689075
Log:
 Principal cache settings moved into parent class 

Modified:
    tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/FormAuthModule.java
    tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/TomcatAuthModule.java

Modified: tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/FormAuthModule.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/FormAuthModule.java?rev=1689075&r1=1689074&r2=1689075&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/FormAuthModule.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/FormAuthModule.java
Fri Jul  3 19:57:38 2015
@@ -107,7 +107,7 @@ public class FormAuthModule extends Tomc
         HttpServletResponse response = (HttpServletResponse) messageInfo.getResponseMessage();
 
         // Have we authenticated this user before but have caching disabled?
-        if (!isCache()) { //TODO Ask is it required? May be principal must be always cached
+        if (!cachePrincipalsInSession) {
             Session session = request.getSessionInternal(true);
             if (log.isDebugEnabled()) {
                 log.debug("Checking for reauthenticate in session " + session);
@@ -125,14 +125,12 @@ public class FormAuthModule extends Tomc
                 }
 
                 session.setNote(Constants.FORM_PRINCIPAL_NOTE, principal);
-                if (!isMatchingSavedRequest(request)) {
-                    handlePrincipalCallbacks(clientSubject, principal);
-                    return AuthStatus.SUCCESS;
+                if (isMatchingSavedRequest(request)) {
+                    return submitSavedRequest(clientSubject, request, response);
                 }
 
-                if (log.isDebugEnabled()) {
-                    log.debug("Reauthentication failed, proceed normally");
-                }
+                handlePrincipalCallbacks(clientSubject, principal);
+                return AuthStatus.SUCCESS;
             }
         }
 
@@ -163,7 +161,7 @@ public class FormAuthModule extends Tomc
         // If we're caching principals we no longer need getPrincipal the
         // username
         // and password in the session, so remove them
-        if (isCache()) {
+        if (cachePrincipalsInSession) {
             session.removeNote(Constants.SESS_USERNAME_NOTE);
             session.removeNote(Constants.SESS_PASSWORD_NOTE);
         }
@@ -324,11 +322,6 @@ public class FormAuthModule extends Tomc
     }
 
 
-    private boolean isCache() {
-        return true;
-    }
-
-
     @Override
     public AuthStatus secureResponse(MessageInfo messageInfo, Subject serviceSubject)
             throws AuthException {

Modified: tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/TomcatAuthModule.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/TomcatAuthModule.java?rev=1689075&r1=1689074&r2=1689075&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/TomcatAuthModule.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/TomcatAuthModule.java
Fri Jul  3 19:57:38 2015
@@ -51,6 +51,8 @@ public abstract class TomcatAuthModule i
 
     protected Context context;
 
+    protected boolean cachePrincipalsInSession = true;
+
 
     public TomcatAuthModule(Context context) {
         this.context = context;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message