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

277 Views Asked by At

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 Client Id and Secret and RS256, or ES256 and others I can successfully request a JWT token from 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/<my_realm>/protocol/openid-connect/token

As soon as I switch to HS256 and try to request a new JWT token it fails with error:

"parameter client_assertion_type is missing"

What could I be missing in setting up JWT in Keycloak to use HS256?

Any way to troubleshoot this in more detail in keycloak ?

Thanks in advance, Traiano

0

There are 0 best solutions below