Skip to content

Fix SAML remote logout#5992

Merged
orenyk merged 5 commits intomainfrom
oyk-fix-remote-logout
Feb 25, 2022
Merged

Fix SAML remote logout#5992
orenyk merged 5 commits intomainfrom
oyk-fix-remote-logout

Conversation

@orenyk
Copy link
Contributor

@orenyk orenyk commented Feb 24, 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 orenyk marked this pull request as draft February 24, 2022 04:37
@orenyk orenyk changed the title Actually fix SAML remote logout WIP: Actually fix SAML remote logout Feb 24, 2022
@orenyk
Copy link
Contributor Author

orenyk commented Feb 24, 2022

This is not currently working even though it should if I'm understanding everything correctly. The feature spec I wrote passed with the old remote logout implementation (nullifying user.unique_session_id) so perhaps the correct approach is fixing the bug with repeat visitors instead of trying this alternative.

**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 orenyk force-pushed the oyk-fix-remote-logout branch from 7d9f139 to 2f3bc32 Compare February 25, 2022 01:54
@orenyk orenyk marked this pull request as ready for review February 25, 2022 02:42
@orenyk orenyk changed the title WIP: Actually fix SAML remote logout Fix SAML remote logout Feb 25, 2022
@orenyk
Copy link
Contributor Author

orenyk commented Feb 25, 2022

Verified that this works locally with Postman - sending the remote logout request via Postman logged out the user in the browser.

**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 orenyk force-pushed the oyk-fix-remote-logout branch from 2f3bc32 to b37d6ce Compare February 25, 2022 03:00
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, just a few ideas to make the test assertions clearer

@orenyk orenyk force-pushed the oyk-fix-remote-logout branch 3 times, most recently from 6e4ac71 to a058fba Compare February 25, 2022 18:38
@orenyk orenyk force-pushed the oyk-fix-remote-logout branch 2 times, most recently from 61ad582 to 1e86830 Compare February 25, 2022 18:42
@orenyk orenyk force-pushed the oyk-fix-remote-logout branch from 1e86830 to e3bfc0e Compare February 25, 2022 19:03
@orenyk orenyk merged commit 5a11819 into main Feb 25, 2022
@orenyk orenyk deleted the oyk-fix-remote-logout branch February 25, 2022 19:28
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