Skip to content

Commit

Permalink
Keycloak logout url fix by @melthaw #62
Browse files Browse the repository at this point in the history
  • Loading branch information
picman committed Nov 27, 2024
1 parent c8b8a0c commit 5ed5c0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/redmine_oauth/patches/account_controller_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ def logout

session.delete :oauth_login
site = RedmineOauth.site
id = RedmineOauth.client_id
url = signout_url
case RedmineOauth.oauth_name
when 'Azure AD'
logout_user
id = RedmineOauth.client_id
redirect_to "#{site}/#{id}/oauth2/logout?post_logout_redirect_uri=#{url}"
when 'Custom'
logout_user
Expand All @@ -52,9 +52,11 @@ def logout
super
when 'Keycloak'
logout_user
redirect_to "#{site}/realms/#{id}/protocol/openid-connect/logout?redirect_uri=#{url}"
tenant_id = RedmineOauth.tenant_id
redirect_to "#{site}/realms/#{tenant_id}/protocol/openid-connect/logout?redirect_uri=#{url}"
when 'Okta'
logout_user
id = RedmineOauth.client_id
redirect_to "#{site}/oauth2/v1/logout?id_token_hint=#{id}&post_logout_redirect_uri=#{url}"
else
super
Expand Down

0 comments on commit 5ed5c0b

Please sign in to comment.