Validate session token in different server env?

For context. I have a custom built UDP server handling actions for my game. I am using Nakama for everything else, storage,account management, etc.

What I would like to do, is login with Nakama, pass the token through my custom UDP server and have that server validate the token with Nakama before returning any actions. Just for a little extra security. I’ve created a RPC method in nakama but I am not finding anything in the Nakama runtime to validate a token.

1 Like

The session token is encrypted using JWT; The encryption key for the token is called “encryption_key” in the Nakama configuration. Share this value with your UDP server, and simply validate that the signature of the Nakama token passed to it is valid - you don’t need a s2s RPC call for this and all of this can be done locally to your UDP server.

1 Like

This did it, used JOSE library in C# backed to decode the JWT. It has other client libraries for anyone else that might come across this answer.

Thanks Again!