blog-keycloak icon indicating copy to clipboard operation
blog-keycloak copied to clipboard

[Revision] Suggestion to revise the blog

Open jaballogian opened this issue 3 years ago • 0 comments

I found this repository from this blog https://scalac.io/blog/user-authentication-keycloak-1/.

I tried to use keycloack in my react app using that blog and this repo. Then I found an error (clientId was not found) in the app. I tried to search another keycloak in react example and I found this repo https://github.com/react-keycloak/react-keycloak-examples/blob/master/examples/react-navi/src/App.js. I realize that the keycloack settings from both the app are different.

I replaced the keycloak setting (this repo) from this:

const keycloak = Keycloak({
    "realm": "MyDemo",
    "auth-server-url": "http://localhost:8080/auth/",
    "ssl-required": "external",
    "resource": "my-react-client",
    "public-client": true,
    "confidential-port": 0,
});

into this:

const keycloak = Keycloak({
    realm: 'MyDemo',
    url: "http://localhost:8080/auth/",
    clientId: 'my-react-client',
});

and it fixed the react app.

jaballogian avatar Aug 03 '21 07:08 jaballogian