Keycloak JWT doesn't support HS256: Only works with RS* ES* etc ...

213 views
Skip to first unread message

Traiano Welcome

unread,
May 16, 2023, 2:11:08 AM5/16/23
to Keycloak User
Hi All

I'm having trouble using JWT as a bearer token (issued by Keycloak) when switching to HS256 signing algorithm in the KC UI.

If I configure JWT client to use RS256, or ES256 and others the JWT tokens I get allow my curl client to successfully  validate to the KC server:

```
curl -s -X POST \ --data "scope=${SCOPE}" \ --data-urlencode "client_id=${CLIENTID}" \ --data-urlencode "client_secret=${CLIENTSECRET}" \ --data-urlencode "username=${USERNAME}" \ --data-urlencode "password=${PASSWORD}" \ --data-urlencode "grant_type=password" \ https://www.example.com/auth/realms/master/protocol/openid-connect/token

```

As soon as I switch back to  HS256 it fails with error:

"parameter client_assertion_type is missing"

What could I be missing in setting up JWT to us HS256 in the KC UI ?

Thanks in advance,
Traiano
Reply all
Reply to author
Forward
0 new messages