fix(login): treat already-logged-out as success in backchannel logout (#1430)#1431
Open
SAY-5 wants to merge 1 commit intonextcloud:mainfrom
Open
fix(login): treat already-logged-out as success in backchannel logout (#1430)#1431SAY-5 wants to merge 1 commit intonextcloud:mainfrom
SAY-5 wants to merge 1 commit intonextcloud:mainfrom
Conversation
Closes nextcloud#1430. OIDC Backchannel Logout 1.0 §2.6 says: 'If the identified End-User is already logged out at the RP when the logout request is received, the logout is considered to have succeeded.' Today `backChannelLogout()` returns HTTP/400 when the (sid, iss) or (sub, iss) lookup yields no matching session, even though that is exactly the already-logged-out case the spec calls out as a *success*. IdPs (e.g. LemonLDAP, Keycloak) surface this 400 to the end user and log a spurious error. The other validation branches in this method — invalid issuer, invalid signature, missing claims, malformed token — keep their HTTP/400 responses. Only the two 'session not found' paths flip to HTTP/200 + a debug log so administrators can still trace what happened. See https://openid.net/specs/openid-connect-backchannel-1_0.html#BCActions Signed-off-by: SAY-5 <say.apm35@gmail.com>
|
Thanks ! |
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.
Closes #1430.
Summary
Per OIDC Backchannel Logout 1.0 §2.6:
Today
backChannelLogout()returns HTTP/400 when the(sid, iss)or(sub, iss)lookup yields no matching session, which is exactly the already-logged-out case the spec calls out as a success. The reporter (running LemonLDAP) sees a confusing error surfaced on the IdP UI even though the desired state — the RP session being gone — is already true. The same shape would happen with Keycloak, Authelia, etc.Change
Only the two "session not found" paths flip to HTTP/200:
findSessionBySid→DoesNotExistException⇒ returnHTTP/200 OK+ debug log.findSessionsBySubAndIssreturns empty ⇒ returnHTTP/200 OK+ debug log.The other validation branches in the same method — invalid issuer, invalid signature, malformed token, missing claims, multiple-sessions-found — keep their HTTP/400 responses. Operators that need visibility into already-logged-out backchannel calls can flip Nextcloud's
logleveltodebugand see the[BackchannelLogout]line.Mirrors the proposed fix in the issue and the spec citation.
Test plan
LoginControllerTestexists intests/unit/Controller/today, and the existing integration runner undertests/integration/does not cover the backchannel flow. The change is two short branches that swap agetBackchannelLogoutErrorResponse()fornew JSONResponse([], Http::STATUS_OK)plus a debug log; both branches are syntactically equivalent to the existingreturn new JSONResponse([], Http::STATUS_OK)at the end of the success path.git diff --checkclean.Notes