Export JWK from Nakama

Hey everyone! :slight_smile:

We want to use nakama as our one-stop authentication service. As such we have the need for a JWK endpoint that return the information needed to verify the validity of a jwt token generated by nakama in our other services.

Is such an endpoint available? And if not how could I create my own? :pray:

Hello @MWFIAE,

An endpoint for JWT validation is not available, but you can create your own replicating the logic the server users to validate them.

Best

Yes from what I have gathered the jwts used by nakama for authentication only offer symmetrical encryption, so its impossible to have a jwk for that. Instead one has to generate a priv/pub key pair and use that in a custom rpc to generate a jwt and also use the pub key to generate a jwk that can be used by other services for validation. All in all more effort but seemingly doable