user840930
user840930

Reputation: 5578

Keycloak error invalid_client Bearer only not allowed

I'm trying to deploy a very simple REST service secured with keycloak and am getting the following error:

Caused by: org.keycloak.authorization.client.util.HttpResponse.Exception: Unexpected response from server: 400 / Bad Request / Response from server: ("error":"invalid_client","error_description":"Bearer-only not allowed")

What does this error mean? How can I fix it?

Upvotes: 12

Views: 23528

Answers (1)

tryingToLearn
tryingToLearn

Reputation: 11659

Since you have not shared your keycloak config, I am guessing the above error is because you created a bearer only client in keycloak. Keycloak doesn't allow "bearer only" clients to obtain tokens from the server. Try to change your client to "confidential" on the server and set bearer-only on your adapter configuration (keycloak.json).

You can refer this thread for more info: http://keycloak-user.88327.x6.nabble.com/keycloak-user-can-we-use-authorization-with-bearer-only-td2123.html

Upvotes: 20

Related Questions