devsu / keycloak-nodejs-multirealm

Keycloak NodeJS Multi Realm Adapter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grant validation failed. Reason: failed to load public key to verify token.

mNeevetha opened this issue · comments

Hi @c3s4r ,
Using keycloak-connect-multirealm module, I'm able to get the realm name from the token passed in each request, but how do we get the realm-public-key for each realm? Since the realm-public-key is not configured it is resulting in ERROR: Grant validation failed. Reason: failed to load public key to verify token.
Any idea on how this could be achieved? Thanks in Advance!

commented

The key can be found in Realm Settings -> Keys -> Public key (see this Stackoverflow for more details). Set realm-public-key to this value. I've logged a ticket about this problem.

commented

It turns out that when I saw this issue that it was the root certificate authority of my certificate was not trusted by NodeJS.