Skip to content

Conversation

@babs
Copy link
Contributor

@babs babs commented Oct 31, 2022

Description

Try to load the session at sign_out to handle redirect's placeholder replacement: ${id_token}

Allow usage of {id_token} as a rd parameter placeholder for newer keycloak, example:

http://localhost:4180/oauth2/sign_out?rd=http://localhost:8080/auth/realms/testrealm/protocol/openid-connect/logout?id_token_hint={id_token}%26post_logout_redirect_uri=http://localhost:4180/

Motivation and Context

Might be a start for closing #884

How Has This Been Tested?

Tested against local keycloak using a testrealm and a testapp listening on 8080.
The demo link leads to the root path of the app with a properly signed out session from both keycloak and oauth2-proxy

Checklist:

  • My change requires a change to the documentation or CHANGELOG.
  • I have updated the documentation/CHANGELOG accordingly.
  • I have created a feature (non-master) branch for my PR.

…ment

Try to load the session at sign_out to handle redirect's placeholder replacement: `${id_token}`

Allow usage of `${id_token}` as a `rd` parameter placeholder for newer keycloak, example:

http://localhost:4180/oauth2/sign_out?rd=http://localhost:8080/auth/realms/testrealm/protocol/openid-connect/logout?id_token_hint={id_token}%26post_logout_redirect_uri=http://localhost:4180/
@babs babs requested a review from a team as a code owner October 31, 2022 20:04
@babs
Copy link
Contributor Author

babs commented Oct 31, 2022

An option could be an oauth2-proxy to provider call but might require to add a new option to specify the logout URL including arguments and placeholders as it's not covered by the standard :/

Edit: #1876

@babs babs changed the title Session aware sign_out for redirect ${id_token} placeholder replacement Session aware sign_out for redirect {id_token} placeholder replacement Dec 15, 2022
@JoelSpeed
Copy link
Member

An option could be an oauth2-proxy to provider call but might require to add a new option to specify the logout URL including arguments and placeholders as it's not covered by the standard :/

Apologies, I haven't been able to get to this project much lately. But, this is kind of what I was expecting.

My understanding was that there's a logout URL in the OIDC discovery document that we can cache and then, with some token, send a request to that to log the session out, is this not a standard thing? Do you know at all?

@JoelSpeed
Copy link
Member

The code here looks pretty simple, how generic is this approach? Are we expecting this could be flexible enough to work for the majority of providers? Are there providers that need anything other than the ID Token?

I'm also wondering if we want to make this a configurable URL, I'd like to refactor the provider implementation at some point so you can add arbitrary params to each URL, so perhaps having some substitution in there isn't a bad thing 🤔 Feeling inspired right now 😅

@babs
Copy link
Contributor Author

babs commented Feb 3, 2023

I think it's a Keycloak specificity but I'm not specialist of others providers

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

This pull request has been inactive for 60 days. If the pull request is still relevant please comment to re-activate the pull request. If no action is taken within 7 days, the pull request will be marked closed.

@github-actions github-actions bot added the Stale label Apr 5, 2023
@Guite
Copy link

Guite commented Apr 5, 2023

Not stale.

@JoelSpeed JoelSpeed removed the Stale label Apr 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

This pull request has been inactive for 60 days. If the pull request is still relevant please comment to re-activate the pull request. If no action is taken within 7 days, the pull request will be marked closed.

@github-actions github-actions bot added the Stale label Jun 6, 2023
@babs
Copy link
Contributor Author

babs commented Jun 6, 2023

still relevant IMHO

@github-actions github-actions bot removed the Stale label Jun 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2023

This pull request has been inactive for 60 days. If the pull request is still relevant please comment to re-activate the pull request. If no action is taken within 7 days, the pull request will be marked closed.

@github-actions github-actions bot added the Stale label Aug 6, 2023
@babs
Copy link
Contributor Author

babs commented Aug 6, 2023

Still relevant

@github-actions github-actions bot removed the Stale label Aug 7, 2023
@JoelSpeed
Copy link
Member

I'd like to see if there's some generic use for this before we merge. Is there anything in the OIDC spec that details how logouts should work?

If this is something that's provider specific then we should probably look at implementing it directly in a provider specific logout and not require users to have to hack around it

@babs
Copy link
Contributor Author

babs commented Sep 22, 2023

There is no standard unfortunately :/

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2023

This pull request has been inactive for 60 days. If the pull request is still relevant please comment to re-activate the pull request. If no action is taken within 7 days, the pull request will be marked closed.

@github-actions github-actions bot added the Stale label Dec 1, 2023
@babs
Copy link
Contributor Author

babs commented Dec 2, 2023

Not stale

@github-actions github-actions bot removed the Stale label Dec 3, 2023
Copy link
Member

@kvanzuijlen kvanzuijlen left a comment

Choose a reason for hiding this comment

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

@babs Is this PR replaced by #1876?

@babs
Copy link
Contributor Author

babs commented Jan 3, 2024

yes, I think backend logout is way more secure than redirect.

@tuunit
Copy link
Member

tuunit commented Jan 4, 2024

Closing in favour of #1876.

@tuunit tuunit closed this Jan 4, 2024
@babs babs deleted the session-aware-logout branch January 5, 2024 20:48
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.

5 participants