Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EE14618E54 for ; Fri, 3 Jul 2015 19:57:39 +0000 (UTC) Received: (qmail 56210 invoked by uid 500); 3 Jul 2015 19:57:39 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 56133 invoked by uid 500); 3 Jul 2015 19:57:39 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 56123 invoked by uid 99); 3 Jul 2015 19:57:39 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jul 2015 19:57:39 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 293C7AC048D for ; Fri, 3 Jul 2015 19:57:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: dev@tomcat.apache.org From: markt@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150703195739.293C7AC048D@hades.apache.org> 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