简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM