Skip to content

Correctly invalidate session for SAML Remote Logout#5990

Merged
orenyk merged 1 commit intomainfrom
oyk-better-remote-logout
Feb 24, 2022
Merged

Correctly invalidate session for SAML Remote Logout#5990
orenyk merged 1 commit intomainfrom
oyk-better-remote-logout

Conversation

@orenyk
Copy link
Contributor

@orenyk orenyk commented Feb 23, 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.

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a few small comments about naming, but once we fix those I think it's good to go

Comment on lines 24 to 25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could probably remove this and have the tests use the other class directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think since it includes the JSON formatting in a way that is expected by load it makes sense to keep it separate.

@orenyk orenyk force-pushed the oyk-better-remote-logout branch from f69feea to 7176bde Compare February 23, 2022 23:13
**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
@orenyk orenyk force-pushed the oyk-better-remote-logout branch from 7176bde to 582dfb2 Compare February 23, 2022 23:42
@orenyk orenyk merged commit 0625bb8 into main Feb 24, 2022
@orenyk orenyk deleted the oyk-better-remote-logout branch February 24, 2022 00:23
@orenyk orenyk mentioned this pull request Feb 24, 2022
orenyk added a commit that referenced this pull request Feb 24, 2022
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants