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

Keycloak 18 - Parameter redirect_uri while logout #84

Open
Deejayfool opened this issue Apr 22, 2022 · 10 comments · May be fixed by #132
Open

Keycloak 18 - Parameter redirect_uri while logout #84

Deejayfool opened this issue Apr 22, 2022 · 10 comments · May be fixed by #132
Labels
checking Checking the issue enhancement New feature or request

Comments

@Deejayfool
Copy link

Describe the bug

Since Keycloak 18, parameter "redirect_uri" is not supported anymore when logging out as explained here : https://www.keycloak.org/2022/04/keycloak-1800-released#_openid_connect_logout
So now, when we use react-native-keycloak, we get the error "Invalid parameter: redirect_uri" when logging out.

Version to reproduce the bug

  • Keycloak Server : 18.0.0
  • Packages npm :
    • react-native-keycloak : 0.6.0
    • keycloak-js : 18.0.0
@IronTony IronTony added enhancement New feature or request checking Checking the issue labels Apr 22, 2022
@sundayglee
Copy link

sundayglee commented May 20, 2022

Any feedback on how to solve this?

@jonathanforking
Copy link

I used this as a workaround for the issue in the meantime

InAppBrowser.open(
  keycloak
    .createLogoutUrl()
    .replace("redirect_uri", "post_logout_redirect_uri") +
  `&id_token_hint=${keycloak.idToken}`
).then(res => keycloak.clearToken())

@4ND3R50N
Copy link

Just wanted to bump this up! Would be awesome to get a working logout for Keycloak > v18 with this component

Keep up the good work!

@IronTony
Copy link
Collaborator

IronTony commented Aug 23, 2022

Hi @4ND3R50N, at the moment due also the real life job we are a little bit busy and React-Native-Keycloak was completely written by ourself from scratch, so first of all we have to check the Keycloak 18 code and plan to rewrite again, that at the moment is not possible.

As you know we created this package without any support or request to users, so obviously we consider to rewrite based on K18, but when we have time from our real life job (that pays the rents)

@detinho
Copy link

detinho commented Dec 8, 2022

Would a PR to make the redirect_uri optional and adding two more options (post_logout_redirect_uri and id_token_hint) to the logout options do the job?

I see here that redirect_uri is always set. If we make them optional we can allow client applications to decide which strategy to use.

@kosbog
Copy link

kosbog commented Feb 17, 2023

Faced with the same error.

@nemanjarocks
Copy link

Have the same problem

@atrofimenko
Copy link

I used this as a workaround for the issue in the meantime

InAppBrowser.open(
  keycloak
    .createLogoutUrl()
    .replace("redirect_uri", "post_logout_redirect_uri") +
  `&id_token_hint=${keycloak.idToken}`
).then(res => keycloak.clearToken())

Hello @jonathanforking, tried your solution, but when I'm opening browser with this url i can see just an empty page. M.B. you have any thoughts here?

@jonathanforking
Copy link

@atrofimenko I ended up using another OAuth library back then (react-native-app-auth), I would suggest doing the same, as this one isn't maintained anymore

@atrofimenko
Copy link

@atrofimenko I ended up using another OAuth library back then (react-native-app-auth), I would suggest doing the same, as this one isn't maintained anymore

@jonathanforking Yes, thank you) testing it right now)

@dstoneva dstoneva linked a pull request Oct 9, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checking Checking the issue enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants