Description
Summary
I have been using Keycloak's Spring Boot Adapter so far. The problem is the continuous necessity to keep the dependency up-to-date in every platform update. That's why, with Spring Security 5.2.x+ generic support, I had considered delegating this integration to Spring's.
There's one specific feature from Keycloak that isn't currently supported: single logout through the backchannel.
This Keycloak's issue details how it could be achieved in a generic way: if there were a way to propagate a client_session_state
param during the token exchange invocation, backchannel support would work, enabling Single Logout accross the realm.
Actual Behavior
After logging out, keycloak tries to invoke the backchannel but can't locate the associated sessions:
19:49:02,605 DEBUG [org.keycloak.services.managers.AuthenticationManager] (default task-1) backchannel logout to: resource-server-2
19:49:02,605 DEBUG [org.keycloak.services.managers.ResourceAdminManager] (default task-1) Cant logout {0}: no logged adapter sessions
This makes the application that logged out, actually need to reauthenticate, but leaves all the others with an active session.
Expected Behavior
Logging out from one application should allow automatic logout from all the others.
Configuration
Sample project that shows this behaviour: https://github.com/codependent/spring-boot-2-oidc-sample
I've tested with Keycloal 8.0.1. Just created a realm insight
with two confidential clients: resourcer-server-1 and resource-server-2, configuring each Admin URL to their context roots.
Version
5.2.x
Sample
https://github.com/codependent/spring-boot-2-oidc-sample