Skip to content

Commit 0f751d0

Browse files
author
Mark Putsiata
committed
Improve AbstractPreAuthenticatedProcessingFilter docs
Clarify misleading SecurityContextRepository setter documentation. Note that AbstractPreAuthenticatedProcessingFilter saves the SecurityContext upon successful authentication, and this behavior can be customized via the setSecurityContextRepository setter. Closes spring-projectsgh-14137 Signed-off-by: Mark Putsiata <[email protected]>
1 parent bb2fd24 commit 0f751d0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

web/src/main/java/org/springframework/security/web/authentication/preauth/AbstractPreAuthenticatedProcessingFilter.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -79,6 +79,10 @@
7979
* raised by the <tt>AuthenticationManager</tt> will the be re-thrown. Note that this will
8080
* not affect cases where the principal returned by {@link #getPreAuthenticatedPrincipal}
8181
* 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}.
8286
*
8387
* @author Luke Taylor
8488
* @author Ruud Senden
@@ -253,8 +257,8 @@ public void setApplicationEventPublisher(ApplicationEventPublisher anApplication
253257

254258
/**
255259
* 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}.
258262
* @param securityContextRepository the {@link SecurityContextRepository} to use.
259263
* Cannot be null.
260264
*/

0 commit comments

Comments
 (0)