Skip to content

Commit 279cb89

Browse files
committed
Merge branch '6.2.x' into 6.3.x
2 parents 6ea33ce + 2ba9b68 commit 279cb89

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

config/src/test/java/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2LoginConfigurerTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ public void logoutWhenUsingOidcLogoutHandlerThenRedirects() throws Exception {
650650
}
651651

652652
@Test
653-
public void configureWhenOidcSessionStrategyThenUses() {
653+
public void configureWhenOidcSessionRegistryThenUses() {
654654
this.spring.register(OAuth2LoginWithOidcSessionRegistry.class).autowire();
655655
OidcSessionRegistry registry = this.spring.getContext().getBean(OidcSessionRegistry.class);
656656
this.spring.getContext().publishEvent(new HttpSessionDestroyedEvent(this.request.getSession()));

docs/modules/ROOT/pages/reactive/oauth2/login/logout.adoc

+9-9
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Consider a `ClientRegistration` whose identifier is `registrationId`.
187187

188188
The overall flow for a Back-Channel logout is like this:
189189

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.
191191
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.
192192
3. Spring Security validates the token's signature and claims.
193193
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:
197197
Remember that Spring Security's OIDC support is multi-tenant.
198198
This means that it will only terminate sessions whose Client matches the `aud` claim in the Logout Token.
199199

200-
=== Customizing the OIDC Provider Session Strategy
200+
=== Customizing the OIDC Provider Session Registry
201201

202202
By default, Spring Security stores in-memory all links between the OIDC Provider session and the Client session.
203203

204204
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.
205205

206-
You can achieve this by configuring a custom `ReactiveOidcSessionStrategy`, like so:
206+
You can achieve this by configuring a custom `ReactiveOidcSessionRegistry`, like so:
207207

208208
[tabs]
209209
======
@@ -212,23 +212,23 @@ Java::
212212
[source,java,role="primary"]
213213
----
214214
@Component
215-
public final class MySpringDataOidcSessionStrategy implements OidcSessionStrategy {
215+
public final class MySpringDataOidcSessionRegistry implements ReactiveOidcSessionRegistry {
216216
private final OidcProviderSessionRepository sessions;
217217
218218
// ...
219219
220220
@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);
223223
}
224224
225225
@Override
226-
public OidcSessionInformation(String clientSessionId) {
226+
public Mono<OidcSessionInformation> removeSessionInformation(String clientSessionId) {
227227
return this.sessions.removeByClientSessionId(clientSessionId);
228228
}
229229
230230
@Override
231-
public Iterable<OidcSessionInformation> removeSessionInformation(OidcLogoutToken token) {
231+
public Flux<OidcSessionInformation> removeSessionInformation(OidcLogoutToken token) {
232232
return token.getSessionId() != null ?
233233
this.sessions.removeBySessionIdAndIssuerAndAudience(...) :
234234
this.sessions.removeBySubjectAndIssuerAndAudience(...);
@@ -241,7 +241,7 @@ Kotlin::
241241
[source,kotlin,role="secondary"]
242242
----
243243
@Component
244-
class MySpringDataOidcSessionStrategy: ReactiveOidcSessionStrategy {
244+
class MySpringDataOidcSessionRegistry: ReactiveOidcSessionRegistry {
245245
val sessions: OidcProviderSessionRepository
246246
247247
// ...

docs/modules/ROOT/pages/servlet/oauth2/login/logout.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ Consider a `ClientRegistration` whose identifier is `registrationId`.
213213

214214
The overall flow for a Back-Channel logout is like this:
215215

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.
217217
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.
218218
3. Spring Security validates the token's signature and claims.
219219
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:
223223
Remember that Spring Security's OIDC support is multi-tenant.
224224
This means that it will only terminate sessions whose Client matches the `aud` claim in the Logout Token.
225225

226-
=== Customizing the OIDC Provider Session Strategy
226+
=== Customizing the OIDC Provider Session Registry
227227

228228
By default, Spring Security stores in-memory all links between the OIDC Provider session and the Client session.
229229

230230
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.
231231

232-
You can achieve this by configuring a custom `OidcSessionStrategy`, like so:
232+
You can achieve this by configuring a custom `OidcSessionRegistry`, like so:
233233

234234
[tabs]
235235
======
@@ -238,7 +238,7 @@ Java::
238238
[source,java,role="primary"]
239239
----
240240
@Component
241-
public final class MySpringDataOidcSessionStrategy implements OidcSessionStrategy {
241+
public final class MySpringDataOidcSessionRegistry implements OidcSessionRegistry {
242242
private final OidcProviderSessionRepository sessions;
243243
244244
// ...
@@ -249,7 +249,7 @@ public final class MySpringDataOidcSessionStrategy implements OidcSessionStrateg
249249
}
250250
251251
@Override
252-
public OidcSessionInformation(String clientSessionId) {
252+
public OidcSessionInformation removeSessionInformation(String clientSessionId) {
253253
return this.sessions.removeByClientSessionId(clientSessionId);
254254
}
255255
@@ -267,7 +267,7 @@ Kotlin::
267267
[source,kotlin,role="secondary"]
268268
----
269269
@Component
270-
class MySpringDataOidcSessionStrategy: OidcSessionStrategy {
270+
class MySpringDataOidcSessionRegistry: OidcSessionRegistry {
271271
val sessions: OidcProviderSessionRepository
272272
273273
// ...

0 commit comments

Comments
 (0)