Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: keycloak authentication post logout redirect for Keycloak 18+ #5878

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

qfluxlab
Copy link
Contributor

What?

This fixes the Keycloak authentication strategy post logout redirect from Keycloak 18 and above when 'Logout from Keycloak on Logout' is enabled. Additionally, a new parameter has been added to the strategy config to enable the old behavior for legacy versions of Keycloak.

This was brought up in discussion #5213 and partially addressed in unmerged #5513. That PR fixes the logout error in Keycloak 18+, but doesn't provide a redirect back to the wiki.

Why?

In older versions of Keycloak, the 'redirect_uri' parameter can be passed to the logout endpoint to automatically log out and redirect afterwards. Starting with Keycloak 18, this has been replaced with 'post_logout_redirect_uri'. This parameter must be accompanied by 'id_token_hint' with its value set to the id_token obtained at login.

How?

The id_token from Keycloak is saved to the user's session upon successful authentication and added as 'id_token_hint' when generating the post logout redirect. Enabling 'Legacy Logout Redirect' in the strategy config will revert to the old behavior of using only 'redirect_uri'.

@NGPixel NGPixel merged commit 491d63c into requarks:main Aug 10, 2023
jionggyu pushed a commit to jionggyu/wiki-2.5.302-patch that referenced this pull request Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
under review Acknowledged, awaiting further review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants