Step 1: Create a private key
This requires you to haveopenssl installed on your machine. If you don’t have openssl installed, you can use online tools like this one to generate a private key and public key instead. The private key needs to have a key length of at least 2048 bits.
Run the following command to generate a private key:
Generate a private key
Step 2: Create a public key
In the same directory as where you created the private key, run the following command to get a public key:Generate a public key
Step 3: Create a JWK from the public key
The easiest way to create a JWKS from the public key is to use an online tool such as PEM to JWK Converter. You can print the PEM encoded public key with this command:Print the PEM encoded public key
- Signing Algorithm:
RS256 - Public Key Use: Signing
- Key ID: You can leave empty to auto-generate.
- PEM Encoded Key: Paste the PEM encoded public key here, including the
-----BEGIN PUBLIC KEY-----and-----END PUBLIC KEY-----lines.
Step 4: Create a JWKS from the JWK
Copy the JWK from previous step, and wrap it in a JSON object withkeys array.
Example JWKS
Step 5: Set up JWKS in your game settings
- Navigate to your game settings in Theymes Support Application.
- Open the Player verification tab.
- Enable player verification.
- Choose
Enter JWKS manuallyfrom the “How to verify players” dropdown. - Paste the JWKS from previous step to the JWKS textarea.
- Choose do you want to allow or block unverified players. If all of your players are verified, we recommend that you block unverified players.
- Click Save changes to save your changes.
Step 6: Ready to go!
Your game is now setup to receive and verify signed player metadata. Remember that when you sign your player metadata, you need to include the key ID in thekid field of the JWT header. Most libraries will allow you to pass the key ID as an option when signing the JWT.
Here is an example of how to sign a player metadata token.
- Javascript
If you got a successful validation result, you’re now ready to send your signed player metadata from your game or web site to Theymes!