Do not end session when switching languages during forced re-authentication OIDC request (LG-10936)#9157
Merged
mitchellhenke merged 2 commits intomainfrom Sep 6, 2023
Conversation
…cation OIDC request changelog: Bug Fixes, OpenID Connect, Do not end session when switching languages during forced re-authentication request
mitchellhenke
commented
Sep 6, 2023
spec/controllers/openid_connect/authorization_controller_spec.rb
Outdated
Show resolved
Hide resolved
Jeremy1026
approved these changes
Sep 6, 2023
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
zachmargolis
added a commit
that referenced
this pull request
Sep 7, 2023
…cation OIDC request (LG-10936) (#9157) * Do not end session when switching languages during forced re-authentication OIDC request changelog: Bug Fixes, OpenID Connect, Do not end session when switching languages during forced re-authentication request * Update spec/controllers/openid_connect/authorization_controller_spec.rb Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com> --------- Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com> (cherry picked from commit 6b221d2)
Merged
Merged
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.
🎫 Ticket
LG-10936
🛠 Summary of changes
This was a bug introduced from the changes in #8684. If an OIDC authorization request is received that uses
prompt=login, and the user switches languages, they will be logged out and have to authenticate again, which is not intended. The core of the issue is due to the OIDC state session check not being set each time. This was working most of the time because the comparison of the URL here only triggers a log out when the URL has changed from the original request. Because the locale is part of the URL, it falls through that check and logs the user out again.To address this, this PR ensures the
oidc_state_for_login_promptvalue is set regardless. The intention behind this is that the state will only be nil once on the initial request. Any OIDC request following that will not log the user out because the state will match.