react-native-keycloak icon indicating copy to clipboard operation
react-native-keycloak copied to clipboard

Keycloak 18 - Parameter redirect_uri while logout

Open Deejayfool opened this issue 2 years ago • 10 comments

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

Deejayfool avatar Apr 22 '22 16:04 Deejayfool

Any feedback on how to solve this?

sundayglee avatar May 20 '22 14:05 sundayglee

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())

jonathanforking avatar May 26 '22 11:05 jonathanforking

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!

4ND3R50N avatar Aug 22 '22 20:08 4ND3R50N

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)

IronTony avatar Aug 23 '22 14:08 IronTony

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.

detinho avatar Dec 08 '22 00:12 detinho

Faced with the same error.

kosbog avatar Feb 17 '23 13:02 kosbog

Have the same problem

nemanjarocks avatar Aug 29 '23 10:08 nemanjarocks