- Home /
Question by
chiayj-wa16 · Dec 27, 2021 at 04:34 AM ·
authenticationvalidationtoken
Unity Authentication - How to check token validity?
After the user sign in and make requests to my backend (not Unity project), I need a way to verify that the user sending the request is valid.
Is there an API that can check the validity of the access token returned after user sign in through Unity AuthenticationService?
Comment
Best Answer
Answer by chiayj-wa16 · Dec 30, 2021 at 01:53 AM
It seems like Unity does not provide any API for that. I done it by validating the signature of the JWT using the Unity jwks.
Link to Unity jwks : https://api.prd.identity.corp.unity3d.com/.well-known/jwks.json
What I used for reference : https://stackoverflow.com/questions/34403823/verifying-jwt-signed-with-the-rs256-algorithm-using-public-key-in-c-sharp