This repository has been archived by the owner on Apr 3, 2023. It is now read-only.
Keycloak configuration in React JS app #194
Unanswered
sapiens-shahbaz-khan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
My keycloak client is configured with access type : confidential and I have generated the secret key.
In my react JS app I am using the below provider
import { ReactKeycloakProvider} from '@react-keycloak/web';
In the provider I am passing authClient & initOptions as props which are as follows:
authClient: Keycloak({ clientId: 'secured-client', realm: 'the-realm', url: REACT_APP_KEYCLOAK_AUTH_DOMAIN, }), initOptions:{ onLoad: 'check-sso', messageReceiveTimeout: 2000, }
If I launch my app with keycloak server configured with access type confidential, it gives 401 error :
error: "unauthorized_client" error_description: "Client secret not provided in request"
Taking reference of the keycloak docs, how the java adapters can be configured,
I tried putting credentials in the initOptions and also clientSecret with the key. But it doesn't seem to work.
What is the right way to pass the secret key from a frontend application in my case a React JS app?
Beta Was this translation helpful? Give feedback.
All reactions