Correctly invalidate session for SAML Remote Logout#5990
Merged
Conversation
zachmargolis
approved these changes
Feb 23, 2022
Contributor
zachmargolis
left a comment
There was a problem hiding this comment.
LGTM, a few small comments about naming, but once we fix those I think it's good to go
app/services/pii/session_store.rb
Outdated
Comment on lines
24
to
25
Contributor
There was a problem hiding this comment.
we could probably remove this and have the tests use the other class directly?
Contributor
Author
There was a problem hiding this comment.
I think since it includes the JSON formatting in a way that is expected by load it makes sense to keep it separate.
f69feea to
7176bde
Compare
**Why:** the way this currently worked led to the user's session being cleared on subsequent visits, which meant that any authentication request information was lost. This correctly deletes the session from the Redis cache. changelog: Bug Fixes, Authentication, Fixed issue with SAML remote logout causing subsequent authentication requests not to redirect correctly
7176bde to
582dfb2
Compare
Merged
orenyk
added a commit
that referenced
this pull request
Feb 24, 2022
This reverts commit 0625bb8. [skip changelog]
orenyk
added a commit
that referenced
this pull request
Feb 24, 2022
orenyk
added a commit
that referenced
this pull request
Feb 25, 2022
**Why:** the way this currently worked led to the user's session being cleared on subsequent visits, which meant that any authentication request information was lost. This correctly deletes the session from the Redis cache. changelog: Bug Fixes, Authentication, Fix issue with SAML remote logout causing subsequent authentication requests not to redirect correctly
orenyk
added a commit
that referenced
this pull request
Feb 25, 2022
**Why:** The recent updates were not actually working - we were using the incorrect session key to invalidate the session in redis. This update stores the session ID on the SP identity record during SAML authentication (similar to OIDC) so that it can be retrieved during remote logout. This is actually a safer behavior since it means that a user will only be logged out if the session they logged in with is still valid (whereas before they would have been logged out regardless if they had started a new Login.gov session after authenticating to the SP). [skip changelog] # covered by entry in #5990
orenyk
added a commit
that referenced
this pull request
Feb 25, 2022
Correctly invalidate session for SAML Remote Logout (#5990) **Why:** the way this currently worked led to the user's session being cleared on subsequent visits, which meant that any authentication request information was lost. This correctly deletes the session from the Redis cache. It also refactors out an OutOfBandSessionAccessor service object for this purpose and adds a feature spec for remote logout. changelog: Bug Fixes, Authentication, Fix issue with SAML remote logout causing subsequent authentication requests not to redirect correctly * Actually fix SAML remote logout **Why:** The recent updates were not actually working - we were using the incorrect session key to invalidate the session in redis. This update stores the session ID on the SP identity record during SAML authentication (similar to OIDC) so that it can be retrieved during remote logout. This is actually a safer behavior since it means that a user will only be logged out if the session they logged in with is still valid (whereas before they would have been logged out regardless if they had started a new Login.gov session after authenticating to the SP). Co-authored-by: Zach Margolis <zachary.margolis@gsa.gov>
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.
Why: the way this currently worked led to the user's session being
cleared on subsequent visits, which meant that any authentication
request information was lost. This correctly deletes the session from
the Redis cache.