Repository navigation
IdP backchannel logout: read sid claim from ID token to support backchannel logout - #48674
Merged
mposolda merged 1 commit intoMay 18, 2026
Merged
Conversation
Signed-off-by: Faseela K <faseela.k@est.tech>
kfaseela
force-pushed
the
fix/idp-backchannel-logout-sid-claim
branch
from
May 4, 2026 12:22
519a43b to
ee8f009
Compare
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.forms.BruteForceTest#testNoFailureResetForPermanentLockout |
mposolda
approved these changes
May 18, 2026
Contributor
There was a problem hiding this comment.
@kfaseela Thanks for the PR.
The OIDCIdentityProviderTest in the services module is not ideal, however I am accepting this since it is very hard to properly test this in automated way due the fact that Keycloak adds the sessionState to the token response.
Closed
sashyo
pushed a commit
to tide-foundation/keycloak-IGA
that referenced
this pull request
Jul 20, 2026
…oak#48674) closes keycloak#12142 Signed-off-by: Faseela K <faseela.k@est.tech>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12142
<Fix is as well suggested by @mposolda on the above issue>
Description:
When an external IdP includes a sid claim in the ID token (as required by the OIDC Back-Channel Logout spec), Keycloak was ignoring it and only reading session_state from the token response. This left brokerSessionId as null, causing backchannel logout requests to silently no-op, the session was never found and never terminated.
This fix reads sid from the ID token and prefers it over session_state when setting brokerSessionId. A WARN is logged if both are present but differ.
Manual verification:
Inspired from and updated on top of: #12142 (comment)
(Issue was also reproduced in the same setup without the fix: broker_session_id was NULL in Postgres, backchannel logout returned 200 but the session remained active in the Admin UI.)