Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 772
user840930 Avatar asked Sep 19 '18 21:09

user840930


1 Answers

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

like image 132
tryingToLearn Avatar answered Sep 21 '22 07:09

tryingToLearn