Puneet
Puneet

Reputation: 763

Setting up keycloak bearer-only client with https keycloak server

I have been trying to setup keycloak bearer-only client.Followed the steps mentioned in the keycloak documentation for javascript adapter. http works fine. With https, I was getting "Access Denied". Below is the keycloak.json used in the client. { "realm": "MyRealm", "auth-server-url": "https://10.65.107.118:8043/auth", "ssl-required": "none", "resource": "edge", "bearer-only": true, "public-client": true, "use-resource-role-mappings": true, "confidential-port": 0 }

Upvotes: 2

Views: 2027

Answers (2)

PKS
PKS

Reputation: 763

For me, I missed the keycloak.auth-server-url in the backend .I added it and it worked

Upvotes: 0

Puneet
Puneet

Reputation: 763

The solution is to add "realm-public-key" in the keycloak.json.

The value of realm-public-key can be found from keycloak server. That is going to realm settings , one can find the public-key and copy-paste it in keycloak.json,to be used by client apps of this realm.

{ "realm": "MyRealm", "auth-server-url": "https://10.65.107.118:8043/auth", "ssl-required": "none", "resource": "edge", "bearer-only": true, "public-client": true, "use-resource-role-mappings": true, "confidential-port": 0, "realm-public-key": "MIIBIjANBgkqh..." }

hope this helps somebody!

Upvotes: 3

Related Questions