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/oauth2/login/logout.adoc
+122Lines changed: 122 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -223,6 +223,128 @@ 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
+
One notable part of this architecture's implementation is that it propagates the incoming back-channel request internally for each corresponding session.
227
+
Initially, this may seem unnecessary.
228
+
However, recall that the Servlet API does not give direct access to the `HttpSession` store.
229
+
By making an internal logout call, the corresponding session can now be validated.
230
+
231
+
Additionally, forging a logout call internally allows for each set of ``LogoutHandler``s to be run against that session and corresponding `SecurityContext`.
232
+
233
+
=== Customizing the Session Logout Endpoint
234
+
235
+
By default, the session logout endpoint is `+{baseScheme}://localhost{basePort}/logout+`.
236
+
The `LogoutHandler` will collect the stored CSRF token and session identifier and populate them into a back-end call that allows the corresponding session to be invalidated.
237
+
238
+
Given that propagating the CSRF token can be a challenge, a new configuration point was released in 6.4 which defaults the endpoint to `+{baseUrl}+/logout/connect/back-channel/+{registrationId}+`.
239
+
You can activate this in the following way:
240
+
241
+
242
+
[tabs]
243
+
======
244
+
Java::
245
+
+
246
+
[source=java,role="primary"]
247
+
----
248
+
http
249
+
// ...
250
+
.oidcLogout((oidc) -> oidc
251
+
.backChannel((backChannel) -> backChannel
252
+
.sessionLogout(Customizer.withDefaults())
253
+
)
254
+
);
255
+
----
256
+
257
+
Kotlin::
258
+
+
259
+
[source=kotlin,role="secondary"]
260
+
----
261
+
http {
262
+
oidcLogout {
263
+
backChannel {
264
+
sessionLogout { }
265
+
}
266
+
}
267
+
}
268
+
----
269
+
======
270
+
271
+
In the event that you need to customize the endpoint, you can provide the URL as follows:
0 commit comments