OferT
October 5, 2021, 6:51am
1
I see the JS & Cordova are supported but I missed any part about react native.
what is the best way to integrate? is there a community or official adapter that is recommended?
thanks for the help!
xgp
October 5, 2021, 10:34am
2
I don’t believe there is an official adapter, but I’ve used this one successfully: GitHub - react-keycloak/react-native-keycloak: React Native components for Keycloak
OferT
October 5, 2021, 11:10am
3
I have checked react-native-keycloak and it does work, but it seems like all the interfaces are done from scratch and are not based on keycloak-js like it should:
[[_javascript_adapter]]
=== JavaScript Adapter
{project_name} comes with a client-side JavaScript library that can be used to secure HTML5/JavaScript applications. The JavaScript adapter has built-in support for Cordova applications.
The library can be retrieved directly from the {project_name} server at `/auth/js/keycloak.js` and is also distributed as a ZIP archive.
A best practice is to load the JavaScript adapter directly from {project_name} Server as it will automatically be updated when you upgrade the server. If you copy the adapter to your web application instead, make sure you upgrade the adapter only after you have upgraded the server.
One important thing to note about using client-side applications is that the client has to be a public client as there is no secure way to store client
credentials in a client-side application. This makes it very important to make sure the redirect URIs you have configured for the client are correct and as specific as possible.
To use the JavaScript adapter you must first create a client for your application in the {project_name} Administration Console. Make sure `public`
is selected for `Access Type`.
You also need to configure `Valid Redirect URIs` and `Web Origins`. Be as specific as possible as failing to do so may result in a security vulnerability.
Once the client is created click on the `Installation` tab select `Keycloak OIDC JSON` for `Format Option` then click `Download`. The downloaded
`keycloak.json` file should be hosted on your web server at the same location as your HTML pages.
This file has been truncated. show original
Seems too wild for me for least