Pley Authentication

A toolkit (in the Pley SDK) that helps you with authenticating and identifying users.

Authentication is a required feature for most games:
1) The game must recognize the users.
2) Check if they have permission to play.
3) Make sure their previous progress is delivered to them.

Pley's solution for authentication is called AuthKit.
Looking for implementation documentation? Read the authentication how-to here!

AuthKit

AuthKit is Pley's tool to identify, verify, and authenticate users on the Pley platform who is trying to play your games. It integrates with your back-end and provides access to Pley's backend to verify any logged-in users on the platform.

πŸ“˜

Authentication is Unique!

How authentication is solved is often unique, with each game having its own technology to solve it. AuthKit is lightweight β€” it can be adapted to integrate Pley with the exact authentication of your game.

User's ID Journey

Before we look at a user's ID journey on Pley, it is better to define two pieces of information first:

  • Game User ID: This is a unique, permanent ID that identifies the user currently playing your game. The Game User ID is primarily used to authenticate a user when dealing with sensitive processes (for example when buying an item).
  • Session Token: This is a unique token generated every time a user starts a new session for your game (similar to a session ID). This token is only valid for a limited time (~30 minutes). The Session Token is primarily used to verify that a player is a Pley player and to obtain their Game User ID.

With that out of the way, let's look at the user's ID journey:

User's ID journey.

User's ID journey.

It starts with a request submitted from your game client to the Pley SDK using AuthKit. The SDK provides a Session Token to your game client. Your client would then send it to your backend which in turn would send it over to our server (Pley JSON API) that verifies it. If it checks out, it sends back the Game User ID to your backend. At that point, you can store the Game User ID on your backend for further use and send an "authentication completed" flag to the client.

πŸ“˜

Implementation: Getting & Sending Session Token

For the implementation of Pley's authentication and how to fetch/send Pley session tokens, read this how-to guide.