This is an automated email from the ASF dual-hosted git repository.

rmaucher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 3db6f341ed4dc897e16edfb07340f54bd2edf789
Author: opencode <[email protected]>
AuthorDate: Wed Sep 30 10:23:45 2026 +0200

    Initialize the ServerAuthModule before caching the 
SingleModuleServerAuthContext so a failed initialization is not cached 
permanently and can be re-attempted on next use
---
 .../apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java 
b/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java
index 07ccd7d0f9..9563d5d9fa 100644
--- a/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java
+++ b/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java
@@ -616,8 +616,10 @@ public class AuthConfigFactoryImpl extends 
AuthConfigFactory {
             if (serverAuthContext == null) {
                 synchronized (serverAuthContextLock) {
                     if (serverAuthContext == null) {
-                        serverAuthContext = new 
SingleModuleServerAuthContext(serverAuthModule);
+                        // Initialize before caching so that, if 
initialization fails, a half-initialized context is
+                        // not cached permanently and initialization is 
re-attempted on the next use
                         serverAuthModule.initialize(null, null, handler, 
properties);
+                        serverAuthContext = new 
SingleModuleServerAuthContext(serverAuthModule);
                     }
                 }
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to