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
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/servlet/authentication/persistence.adoc
+66
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,72 @@ public SecurityFilterChain filterChain(HttpSecurity http) {
114
114
----
115
115
====
116
116
117
+
[[delegatingsecuritycontextrepository]]
118
+
=== DelegatingSecurityContextRepository
119
+
120
+
The {security-api-url}org/springframework/security/web/context/DelegatingSecurityContextRepository.html[`DelegatingSecurityContextRepository`] saves the `SecurityContext` to multiple `SecurityContextRepository` delegates and allows retrieval from any of the delegates in a specified order.
121
+
122
+
The most useful arrangement for this is configured with the following example, which allows the use of both xref:requestattributesecuritycontextrepository[`RequestAttributeSecurityContextRepository`] and xref:httpsecuritycontextrepository[`HttpSessionSecurityContextRepository`] simultaneously.
123
+
124
+
.Configure DelegatingSecurityContextRepository
125
+
====
126
+
.Java
127
+
[source,java,role="primary"]
128
+
----
129
+
@Bean
130
+
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
0 commit comments