Use Keycloak with react native

Viewed 6442

I'm developing an app for ios and android in react native and need to use keycloak for authorization, but struggling to find a good way.

I've tried react-native-app-auth and it works good to sign in but not to sign out. Not so strange because react-native-app-auth states that: "Keycloak does not specify a revocation endpoint so revoke functionality doesn't work."

I've had a look at a few other npm packages such as react-native-login-keycloak but they seem to lack maintenance and opens a lot of browser tabs.

Any ideas of how to solve this or maybe do a work-around for react-native-app-auth? Thank you for your help!

2 Answers

Check the openid-connect configuration endpoint.

You can find it in your keycloak server

https://{your-keycloak-server}/auth/realms/{your_realm}/.well-known/openid-configuration

you will find the endpoints for:

authorization_endpoint token_endpoint end_session_endpoint

Add those to your react-native-app-auth configuration.

Related