Keycloack js question.

Hi. I’m a user of Quarkus. And I find that I can use the keycloak to unify the security management.
I’m new to Keycloak. I don’t know what’s the problem. Can anyone help me?

I follow this guide.

  1. I start up a docker keycloak on 8180 with the quarkus-realm.json imported.
  2. I create a html in resources/META-INF/resources for this guide’s quickstart project.
  3. I download the adapter config keycloak.json and place it in resources/META-INF/resources.
  4. I visit localhost:8080 and it fails to authenticate.

The quickstart doesn’t come with a single page application demo. It does redirect me to the login page. But after that it failed.

For the keycloak js SPA, Quarkus is not involved in it. So it’s a keycloak question. Can anyone help me?

I tried to use the developer tools of Chrome to debug. Here’s the response for http://localhost:8180/realms/quarkus/protocol/openid-connect/token.
{"error":"unauthorized_client","error_description":"Invalid client or Invalid client credentials"}

And here’s the log in keycloak.
2023-02-03 14:17:01,750 WARN [org.keycloak.events] (executor-thread-10) type=CODE_TO_TOKEN_ERROR, realmId=quarkus, clientId=backend-service, userId=null, ipAddress=172.17.0.1, error=invalid_client_credentials, grant_type=authorization_code

Can anyone help? Thanks.

Hi, try disabling “client authentication” and “authorization” in the clients settings.

1 Like

Thank you. It does help.