Generate a token on a secure server
Before you release your game to production, you need to generate your access tokens on a secure server and then send those access tokens to the game client. Allowing for token generation on the client during production is a security risk and can cause unexpected token expiration errors for your users.
Note: The actual implementation depends on your server programming environment and language.