resolve logout token subject:sessions for the idp backchannel logout#2328
Open
dragonchaser wants to merge 9 commits intoopencloud-eu:mainfrom
Open
resolve logout token subject:sessions for the idp backchannel logout#2328dragonchaser wants to merge 9 commits intoopencloud-eu:mainfrom
dragonchaser wants to merge 9 commits intoopencloud-eu:mainfrom
Conversation
a5ff70e to
8cd6107
Compare
fschade
reviewed
Feb 12, 2026
fschade
reviewed
Feb 12, 2026
8cd6107 to
c051e6e
Compare
c67804e to
6f8c92f
Compare
Member
|
toDo:
|
a10347c to
ae9427a
Compare
micbar
reviewed
Feb 13, 2026
Signed-off-by: Christian Richter <c.richter@opencloud.eu> Co-authored-by: Michael Barz <m.barz@opencloud.eu>
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
Co-authored-by: Jörn Dreyer <j.dreyer@opencloud.eu> Co-authored-by: Michael Barz <m.barz@opencloud.eu> Signed-off-by: Christian Richter <c.richter@opencloud.eu>
ae9427a to
1e53cc9
Compare
Member
|
A few minor things here and there, but it should be fine for now. logout.mp4 |
ed4d19f to
455c703
Compare
455c703 to
da5d1d4
Compare
Member
|
i updated the issue description, hope it makes sense |
|
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.



Description
the backchannel logout only considers the logout token sessionId, as mentioned by the spec,
the sessionId is optional if the subject exists.
The current implementation ignores the subject and fails if the sessionId is not part of the logoutToken.
A more detailed description of the problem and how to reproduce it can be found here.
Related Issue
Motivation and Context
from the spec:
Known side-effects
keyCloak "Sign out all active sessions" does not send a backchannel logout request,
as the devs mention, this may lead to thousands of backchannel logout requests,
therefore, they recommend a short token lifetime.
OIDC: Backchannel logout not being called when using Sign out all Session in Keycloak keycloak/keycloak#27342 (comment)
keyCloak user self-service portal, "Sign out all devices" may not send a backchannel
logout request for each session, it's not mentionex explicitly,
but maybe the reason for that is the same as for "Sign out all active sessions"
to prevent a flood of backchannel logout requests.
if the keyCloak setting "Backchannel logout session required" is disabled (or the token has no session id),
we resolve the session by the subject which can lead to multiple session records (subject.*),
we then send a logout event (sse) to each connected client and delete our stored cache record (subject.session & claim).
all sessions besides the one that triggered the backchannel logout continue to exist in the identity provider,
so the user will not be fully logged out until all sessions are logged out or expired.
this leads to the situation that web renders the logout view even if the instance is not fully logged out yet.
Things to pay special attention to during the review
services/proxy/pkg/middleware/oidc_auth.go{key: ".sessionId"}=> used for*.sessionId{key: "subject.sessionId"}=> used forsubject.*services/proxy/pkg/staticroutes/internal/backchannellogout/backchannellogout.goservices/proxy/pkg/staticroutes/backchannellogout.goToDos:
by the iss and sub Claims..., we don't do that?Questions
How Has This Been Tested?
Types of changes
Checklist: