How do I a player's info (username) from an OAuth token?

Sort:
AliTahboub12

(How do I get**)
After getting the OAuth token, how do I get the user's username? Thanks.

Martin_Stahl

Did you look through the documentation?

https://www.chess.com/announcements/view/chess-com-oauth-login-application

BaileyTownsend

It may be way off, and just general advice, I have not used chess.com's OAuth API. If I'm not mistaken, the token is a JWT. If I had to guess it's in there. Take it in can check it's contents using this website.

https://jwt.io/

Then in your program can use a JWT library to parse it out yourself.

LaithTahboub2005
BaileyTownsend wrote:

It may be way off, and just general advice, I have not used chess.com's OAuth API. If I'm not mistaken, the token is a JWT. If I had to guess it's in there. Take it in can check it's contents using this website.

https://jwt.io/

Then in your program can use a JWT library to parse it out yourself.

Yes this is true. You need some way to decode the JWT, like PYJWT for Python.