Repository navigation
tools/gosamldev: forget a pending SP logout only once the IdP's answer is verified - #1007
Merged
Merged
Conversation
…r is verified The SP's single logout service deleted the logout in progress before ParseResponse checked the LogoutResponse, so a junk response posted with the browser's RelayState cancelled the logout, and the IdP's real answer was then refused as answering no logout in progress. Delete it only when ParseResponse verified the response (success, PartialLogout or another status), as x/samlsp/slo/pendinglogout does. A PartialLogout response, which ParseResponse returns with ErrPartialLogout, now shows its own message instead of the failure one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QFDLnyEpWvYnSDCnCib9sD
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.
Summary
This is the follow-up noted in #996.
The gosamldev SP's single logout service deleted the logout in progress from its store before
ParseResponsechecked the LogoutResponse. So a junk response posted with the browser's RelayState cancelled the logout, and the IdP's real answer was then refused with "No logout is in progress for this LogoutResponse".Changes
server/sp_slo.go:ParseResponseverified the response: success,slo.ErrPartialLogout, or asaml.ErrBadStatus. This is the same rule aspendinglogout.Answeredin x/samlsp/slo/pendinglogout: track logouts in progress in cookies #996.ParseResponsereturns together withErrPartialLogout, now shows the partial-logout message instead of the generic failure. The old check for it sat in the success branch and could never run.TestSingleLogoutJunkResponseKeepsLogout: it starts an SP-initiated logout, posts a junk LogoutResponse with the same RelayState (refused), and then delivers the IdP's real answer, which is still accepted ("Logged out everywhere"). The test fails without the fix.Testing
In
tools/gosamldev:go vet ./...andgo test ./...pass.Generated by Claude Code