You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clarify misleading SecurityContextRepository setter documentation.
Note that AbstractPreAuthenticatedProcessingFilter saves the
SecurityContext upon successful authentication, and this behavior
can be customized via the setSecurityContextRepository setter.
Closesgh-14137
Signed-off-by: Mark Putsiata <[email protected]>
Copy file name to clipboardExpand all lines: web/src/main/java/org/springframework/security/web/authentication/preauth/AbstractPreAuthenticatedProcessingFilter.java
+7-3
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2002-2022 the original author or authors.
2
+
* Copyright 2002-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -79,6 +79,10 @@
79
79
* raised by the <tt>AuthenticationManager</tt> will the be re-thrown. Note that this will
80
80
* not affect cases where the principal returned by {@link #getPreAuthenticatedPrincipal}
81
81
* is null, when the chain will still proceed as normal.
82
+
* <p>
83
+
* The filter saves the {@link SecurityContext} using the configured
84
+
* {@link SecurityContextRepository}, which can be set via
85
+
* {@link #setSecurityContextRepository}.
82
86
*
83
87
* @author Luke Taylor
84
88
* @author Ruud Senden
@@ -253,8 +257,8 @@ public void setApplicationEventPublisher(ApplicationEventPublisher anApplication
253
257
254
258
/**
255
259
* Sets the {@link SecurityContextRepository} to save the {@link SecurityContext} on
256
-
* authentication success. The default action is not to save the
257
-
* {@link SecurityContext}.
260
+
* authentication success. The default action is to save the {@link SecurityContext}
261
+
* in {@link HttpSession} using {@link HttpSessionSecurityContextRepository}.
258
262
* @param securityContextRepository the {@link SecurityContextRepository} to use.
0 commit comments