LG-7434: Support HTTP POST for OIDC logout route#10573
Merged
Conversation
zachmargolis
reviewed
May 8, 2024
**Why**: - The specification for OpenID Connect RP-Initiated Logout 1.0 requires both HTTP `GET` and `POST` methods to be supported. See: https://openid.net/specs/openid-connect-rpinitiated-1_0.html#RPLogout - Data sent using the `POST` method remains encrypted during transport in the browser and in web application logs, preventing leakage of sensitive information **How**: - The same endpoint shall be used, `/openid_connect/logout`, but the request data must be sent as part of the body and use form serialization (RFC 9110, sec. 9.3.3) resolves https://gitlab.login.gov/lg-people/lg-people-appdev/protocols/openid-connect/-/issues/3 changelog: Bug Fixes, Security, Support POST for OIDC RP-Initiated Logout 1.0
d9ff5c7 to
756061e
Compare
zachmargolis
approved these changes
May 13, 2024
aduth
added a commit
that referenced
this pull request
Jul 1, 2024
Signing out would cause current_user to always return nil. This change returns to previous implementation prior to #10573 with order of redirect See: https://github.com/18F/identity-idp/pull/10887/files#r1661091791
aduth
reviewed
Jul 1, 2024
Comment on lines
+128
to
+130
| sign_out | ||
|
|
||
| redirect_user(redirect_uri, @logout_form.service_provider&.issuer, current_user&.uuid) |
Contributor
There was a problem hiding this comment.
Noting that the reordering redirect_user to happen after sign_out caused a change in behavior with current_user always being nil. It wasn't caught in our specs since our stub_sign_in helper wasn't faithfully recreating the behavior of Devise's handling of current_user
I accidentally stumbled into this in #10887 with a change to improve the stubbed sign-out behavior. More info at https://github.com/18F/identity-idp/pull/10887/files#r1661091791.
aduth
added a commit
that referenced
this pull request
Jul 1, 2024
…10887) * LG-13318: Ensure user_id present in account deletion submitted changelog: Internal, Analytics, Ensure user ID present in account deletion submitted * Fix PIV CAC login controller specs The issue was stub_analytics was _also_ being called and causing the controller to memoize analytics result in a way that wasn't previously surfaced since we asserted against analytics_user directly, despite the fact that the analytics method is what's actually used in code for logging * Reorder redirect relative to sign-out Signing out would cause current_user to always return nil. This change returns to previous implementation prior to #10573 with order of redirect See: https://github.com/18F/identity-idp/pull/10887/files#r1661091791
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
Link to the relevant ticket:
LG-7434: Add support for POST OIDC logout requests (this ticket has been superseded by the referenced this GitLab issue).
🛠 Summary of changes
GETandPOST. The route definition has been updated with amatchstatementshared_examplesblocks to make working with different request methods simplerindex.html.erbtemplate as been renamed toconfirm_logout.html.erb📜 Testing Plan
Requires:
identity-idpapp to havereject_id_token_hint_in_logout: trueinapplication.ymlOR the partner app must not send anid_token_hintSteps