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
SessionAuthenticationFilter requires accessing the HttpSession to do its
job. Previously, there was no way to just disable the
SessionAuthenticationFilter despite the fact that
SessionAuthenticationStrategy is invoked by the authentication filters
directly.
This commit adds an option to disable SessionManagmentFilter in favor of
requiring explicit SessionAuthenticationStrategy invocation already
performed by the authentication filters.
Closesgh-11455
Copy file name to clipboardExpand all lines: config/src/main/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurer.java
+38-14
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,8 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
Copy file name to clipboardExpand all lines: config/src/main/resources/org/springframework/security/config/spring-security-5.8.rnc
+3
Original file line number
Diff line number
Diff line change
@@ -917,6 +917,9 @@ session-management =
917
917
## Session-management related functionality is implemented by the addition of a SessionManagementFilter to the filter stack.
918
918
element session-management {session-management.attlist, concurrency-control?}
919
919
920
+
session-management.attlist &=
921
+
## Specifies that SessionAuthenticationStrategy must be explicitly invoked. Default false (i.e. SessionManagementFilter will implicitly invoke SessionAuthenticationStrategy).
## Indicates how session fixation protection will be applied when a user authenticates. If set to "none", no protection will be applied. "newSession" will create a new empty session, with only Spring Security-related attributes migrated. "migrateSession" will create a new session and copy all session attributes to the new session. In Servlet 3.1 (Java EE 7) and newer containers, specifying "changeSessionId" will keep the existing session and use the container-supplied session fixation protection (HttpServletRequest#changeSessionId()). Defaults to "changeSessionId" in Servlet 3.1 and newer containers, "migrateSession" in older containers. Throws an exception if "changeSessionId" is used in older containers.
Setting this attribute to true will mean that `SessionManagementFilter` will not be injected and explicit invocation of SessionAuthenticationStrategy is required.
2249
+
2246
2250
[[nsa-session-management-invalid-session-url]]
2247
2251
* **invalid-session-url**
2248
2252
Setting this attribute will inject the `SessionManagementFilter` with a `SimpleRedirectInvalidSessionStrategy` configured with the attribute value.
0 commit comments