JWT Authentication Details

Configure a JWT secret and learn the required payload formats for authenticating users in your game

Use JWT Authentication

To use a JWT for your game’s authentication, do the following:

  1. Go to the Configuration tab of your game.
  2. In the JWT Auth Secret field, you can either:
    • Provide your own secret key by entering a UTF8 key directly
    • Generate a secure key by clicking the refresh icon.
  3. Save your settings.

This secret key will be used by your system to sign the JWT token's signature using the HS256 algorithm. Xtremepush will use this same secret to verify the token's authenticity.

Required JWT format

The JWT payload must adhere to the following structure for proper user identification and token validation by Xtremepush:

{  
  "account": "34523453",  
  "expiration": "2024-12-18T15:31:00.983Z"  
}
  • Account (required): It must contain the unique User ID of the logged-in user for whom the game is being launched. The value for this field must be a string.
  • Expiration (optional): If included, it defines the validity period of the token. The value must be in ISO 8601 format.