Add id_token_hint to the post logout redirect uri#149
Add id_token_hint to the post logout redirect uri#149CSDUMMI wants to merge 2 commits intoomniauth:masterfrom
Conversation
7af5a58 to
5ff1097
Compare
|
Great work, thank you. |
3fdb802 to
5a1a29c
Compare
|
The tests fail because The tests do not mock this function and thus a request to I don't know enough about stubbing in Ruby to stub this particular behavior. |
|
@stanhu can you review this PR or is there somebody else I can talk to? |
|
|
||
| def test_logout_phase_with_discovery_and_post_logout_redirect_uri | ||
| expected_redirect = 'https://example.com/logout?post_logout_redirect_uri=https%3A%2F%2Fmysite.com' | ||
| expected_redirect = 'https://example.com/logout?post_logout_redirect_uri=https%3A%2F%2Fmysite.com&id_token_hint' |
There was a problem hiding this comment.
Should this value be blank? Should the key be omitted entirely if there is no token?
There was a problem hiding this comment.
I suspect this needs two tests:
- one with an ID token present (such as this) where the redirect URL should contain the
id_token_hintparam with a value of<id-token> - one where the ID token is not present and the redirect URL does not contain the
id_token_hintparam
There was a problem hiding this comment.
I'm not sure whether it's worth the extra effort to create a test case for the second case.
|
|
||
| def test_logout_phase_with_discovery_and_post_logout_redirect_uri | ||
| expected_redirect = 'https://example.com/logout?post_logout_redirect_uri=https%3A%2F%2Fmysite.com' | ||
| expected_redirect = 'https://example.com/logout?post_logout_redirect_uri=https%3A%2F%2Fmysite.com&id_token_hint' |
There was a problem hiding this comment.
| expected_redirect = 'https://example.com/logout?post_logout_redirect_uri=https%3A%2F%2Fmysite.com&id_token_hint' | |
| access_token = stub('OpenIDConnect::AccessToken') | |
| access_token.stubs(:id_token).returns(jwt.to_s) | |
| expected_redirect = "https://example.com/logout?post_logout_redirect_uri=https%3A%2F%2Fmysite.com&id_token_hint=#{access_token.id_token}" |
There was a problem hiding this comment.
Thanks for your suggestion. I applied them and the case passed.
…direct redirect (without confirmation) with some IdP sofware (keycloak)
|
Hello everyone! Will this PR be merged at some point? Thanks for your work. |
|
I would like this to be merged. Are there any concerns with this code? Need any help? |
|
I also need to send id_token_hint, but this solution doesn't work for my client. I'm using authorization_code flow and the call to |
|
I found out that even if this gets merged, I still can't use it with Amazon Cognito because they're not compliant with the OpenID Connect logout specification. Cognito uses different URL parameters ( |
I have the same issue @coberlin, and I will also pass the |
The OneLogin IdP requires the
id_token_hintfield to be set to the previously issued access token in the end session uri to perform a logout and redirect the user to the post logout uri.1The Keycloak IdP requires the
id_token_hintfield to be set to avoid a confirmation dialog before redirecting them to the post logout uri.2This PR adds the
id_token_hintto support this behavior by the IdPs. I'm open to only enabling this through an option that is disabled by default.Footnotes
See OneLogin OIDC post_logout_redirect_uri issue #140 and https://developers.onelogin.com/openid-connect/api/logout ↩
See keycloak documentation: https://www.keycloak.org/docs/latest/securing_apps/#logout ↩