-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Support Keycloak's OIDC backchannel logout #7770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is how Keycloak's adapter sends that information (along with the hostname):
The same could be achieved if there were some way to hook those additional parameters into the
|
It seems that you are referring to OpenID Connect Back-Channel Logout 1.0? But when I read...
This does not sound like OIDC back-channel logout. Can you provide a link to the Keycloak reference docs for this feature so I can better understand? |
Actually their backchannel logout documentation is kind of obscure, and I don't think they follow that spec. This is how clients should be configured to support b-c logout:
That is to say we have to set it up to the root of our application: http://xxx/context-root Their adapters work this way, as shown above:
I understand this behaviour is non standard (spec-wise) but on the other hand it's the only thing that prevents us from using a library, spring security, that decouples us from Keycloak's adapters, but also allows us to use all their features (backchannel logout). It would be great if Spring Security provided a kind of extension to support this specific Keycloak. capability. |
Yes agreed I couldn't find anything.
We do not implement provider specific implementations. Our goal is to be spec-compliant but providing the right amount of extension hooks to allow the user to customize if necessary. We could consider adding support for OpenID Connect Back-Channel Logout 1.0, however, we cannot add any proprietary logic specific to a provider. |
I understand, there's no point in adding custom behaviour in a generalistic framework. I guess I could get by if I extend
|
Answering myself, I managed to solve the previous questions and hook in my own implementation:
Now Keycloak has access to the registered clients and invokes them successfully:
|
@jgrandja Could you give me some hint how to replicate this with a Webflux reactive application? |
For the reactive side, you can supply a custom |
Just one more question: since
|
For anyone stumbling onto this issue months (years) later: OpenID Connect Back-Channel Logout was shipped in Keycloak 12: |
Uh oh!
There was an error while loading. Please reload this page.
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:
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
The text was updated successfully, but these errors were encountered: