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

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

commit 0cfb0ebd972426199f1386c5042ef417db5d1e1d
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 27667d336a..9c3d24631e 100644
--- a/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java
+++ b/java/org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl.java
@@ -636,8 +636,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