JWT public keys are empty
-
Hey there… I’ve been searching for a solution to problem I am having with the /jwt/public-key endpoint. It seems there are no keys being returned. The response is
{"publicKeys":{}}
When I supply an application ID with the request, I get an exception
The @JSONResponse field [response] in the action [class io.fusionauth.app.action.api.jwt.PublicKeyAction] is null. It cannot be null!
Any insight on this? Am I missing a configuration setting somewhere? I would have expected maybe a default key would have been returned.
-
To confirm, you are trying to hit this endpoint to retrieve a public key, correct?
In order to get this endpoint to publish/return your public key, you will need to either import or generate a key pair. I would review whether you are importing an existing key pair or generating a new one here: https://fusionauth.io/docs/v1/tech/core-concepts/key-master#importing-vs-generating
Have you done this step yet? If not, once the pair is imported/generated correctly, this endpoint should return your public key.
If it's still returning an error, please let us know.
As for the @JSONResponse error, we should be handling that and you should be getting this response when hitting the same endpoint with the applicationId.
{}
I opened a bug here if you would like to track it. https://github.com/FusionAuth/fusionauth-issues/issues/1918
Thanks and happy coding,
Johnathon
-
Thanks for the update!