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: config/src/test/java/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2LoginConfigurerTests.java
+1-1
Original file line number
Diff line number
Diff line change
@@ -650,7 +650,7 @@ public void logoutWhenUsingOidcLogoutHandlerThenRedirects() throws Exception {
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/reactive/oauth2/login/logout.adoc
+9-9
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,7 @@ Consider a `ClientRegistration` whose identifier is `registrationId`.
187
187
188
188
The overall flow for a Back-Channel logout is like this:
189
189
190
-
1. At login time, Spring Security correlates the ID Token, CSRF Token, and Provider Session ID (if any) to your application's session id in its `ReactiveOidcSessionStrategy` implementation.
190
+
1. At login time, Spring Security correlates the ID Token, CSRF Token, and Provider Session ID (if any) to your application's session id in its `ReactiveOidcSessionRegistry` implementation.
191
191
2. Then at logout time, your OIDC Provider makes an API call to `/logout/connect/back-channel/registrationId` including a Logout Token that indicates either the `sub` (the End User) or the `sid` (the Provider Session ID) to logout.
192
192
3. Spring Security validates the token's signature and claims.
193
193
4. If the token contains a `sid` claim, then only the Client's session that correlates to that provider session is terminated.
@@ -197,13 +197,13 @@ The overall flow for a Back-Channel logout is like this:
197
197
Remember that Spring Security's OIDC support is multi-tenant.
198
198
This means that it will only terminate sessions whose Client matches the `aud` claim in the Logout Token.
199
199
200
-
=== Customizing the OIDC Provider Session Strategy
200
+
=== Customizing the OIDC Provider Session Registry
201
201
202
202
By default, Spring Security stores in-memory all links between the OIDC Provider session and the Client session.
203
203
204
204
There are a number of circumstances, like a clustered application, where it would be nice to store this instead in a separate location, like a database.
205
205
206
-
You can achieve this by configuring a custom `ReactiveOidcSessionStrategy`, like so:
206
+
You can achieve this by configuring a custom `ReactiveOidcSessionRegistry`, like so:
207
207
208
208
[tabs]
209
209
======
@@ -212,23 +212,23 @@ Java::
212
212
[source,java,role="primary"]
213
213
----
214
214
@Component
215
-
public final class MySpringDataOidcSessionStrategy implements OidcSessionStrategy {
215
+
public final class MySpringDataOidcSessionRegistry implements ReactiveOidcSessionRegistry {
216
216
private final OidcProviderSessionRepository sessions;
217
217
218
218
// ...
219
219
220
220
@Override
221
-
public void saveSessionInformation(OidcSessionInformation info) {
222
-
this.sessions.save(info);
221
+
public Mono<void> saveSessionInformation(OidcSessionInformation info) {
222
+
return this.sessions.save(info);
223
223
}
224
224
225
225
@Override
226
-
public OidcSessionInformation(String clientSessionId) {
226
+
public Mono<OidcSessionInformation> removeSessionInformation(String clientSessionId) {
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/servlet/oauth2/login/logout.adoc
+6-6
Original file line number
Diff line number
Diff line change
@@ -213,7 +213,7 @@ Consider a `ClientRegistration` whose identifier is `registrationId`.
213
213
214
214
The overall flow for a Back-Channel logout is like this:
215
215
216
-
1. At login time, Spring Security correlates the ID Token, CSRF Token, and Provider Session ID (if any) to your application's session id in its `OidcSessionStrategy` implementation.
216
+
1. At login time, Spring Security correlates the ID Token, CSRF Token, and Provider Session ID (if any) to your application's session id in its `OidcSessionRegistry` implementation.
217
217
2. Then at logout time, your OIDC Provider makes an API call to `/logout/connect/back-channel/registrationId` including a Logout Token that indicates either the `sub` (the End User) or the `sid` (the Provider Session ID) to logout.
218
218
3. Spring Security validates the token's signature and claims.
219
219
4. If the token contains a `sid` claim, then only the Client's session that correlates to that provider session is terminated.
@@ -223,13 +223,13 @@ The overall flow for a Back-Channel logout is like this:
223
223
Remember that Spring Security's OIDC support is multi-tenant.
224
224
This means that it will only terminate sessions whose Client matches the `aud` claim in the Logout Token.
225
225
226
-
=== Customizing the OIDC Provider Session Strategy
226
+
=== Customizing the OIDC Provider Session Registry
227
227
228
228
By default, Spring Security stores in-memory all links between the OIDC Provider session and the Client session.
229
229
230
230
There are a number of circumstances, like a clustered application, where it would be nice to store this instead in a separate location, like a database.
231
231
232
-
You can achieve this by configuring a custom `OidcSessionStrategy`, like so:
232
+
You can achieve this by configuring a custom `OidcSessionRegistry`, like so:
233
233
234
234
[tabs]
235
235
======
@@ -238,7 +238,7 @@ Java::
238
238
[source,java,role="primary"]
239
239
----
240
240
@Component
241
-
public final class MySpringDataOidcSessionStrategy implements OidcSessionStrategy {
241
+
public final class MySpringDataOidcSessionRegistry implements OidcSessionRegistry {
242
242
private final OidcProviderSessionRepository sessions;
243
243
244
244
// ...
@@ -249,7 +249,7 @@ public final class MySpringDataOidcSessionStrategy implements OidcSessionStrateg
249
249
}
250
250
251
251
@Override
252
-
public OidcSessionInformation(String clientSessionId) {
252
+
public OidcSessionInformation removeSessionInformation(String clientSessionId) {
0 commit comments