PlayFab

How It Works

  1. Your application (client) sends requests to the Xsolla Login server.
  2. The Xsolla Login server sends requests to PlayFab.
  3. The Xsolla Login server processes the response received from PlayFab and returns the result to your client.
  4. Your client processes this response.

Info: User information is stored both in the PlayFab and Xsolla database. The passwords are kept in the PlayFab database only.

Registration

  1. Your client sends a request to register a user to the Xsolla Login server.
  2. The Xsolla Login server sends the RegisterPlayFabUser request.
  3. User information is written to the Xsolla database, while:
    • The email parameter is flagged as confirmed. The user will not receive an account confirmation email.
    • The password is not written.
  4. The Xsolla Login server sends the AddOrUpdateContactEmail request.
  5. If you have integrated the Login Widget, the user will be redirected to the page with the following message: Please confirm your account following the instructions we sent to {email}. Xsolla will not send this user an email.

Authentication by the Username and Password

  1. Your client sends a request to authenticate the user by the username and password to the Xsolla Login server.
  2. The Xsolla Login server sends the LoginWithEmailAddress request.
  3. The Xsolla Login server generates a user JWT, while:
    • The PlayFabId value from the response to the LoginWithEmailAddress request is written to the external_account_id parameter.
    • The SessionTicket value from the response to the LoginWithEmailAddress request is written to the session_ticket parameter.
  4. The user is redirected to the login_url with a token query parameter. The token parameter contains the user JWT.

If there is no information about this user in the Xsolla database:

  1. The user information is written, while:
    • The email parameter is flagged as confirmed. The user will not receive an account confirmation email.
    • The password is not written.
  2. The Xsolla Login server sends the AddOrUpdateContactEmail request.

Password Reset

  1. Your client sends a request to reset the user password to the Xsolla Login server.
  2. The Xsolla Login server sends the SendAccountRecoveryEmail request.
  3. A new password is written to the PlayFab database.

Authentication via Twitch

When the user clicks on the Twitch authentication button:

  1. Your client sends a request to authenticate the user via Twitch, and the response is the user accessToken. Setup instructions.
  2. The Xsolla Login server sends the LoginWithTwitch request with "CreateAccount":true.
  3. The user information is written to the Xsolla database, while their Twitch account is not added to the entry.
  4. The Xsolla Login server sends the AddOrUpdateContactEmail request.
  5. The Xsolla Login server generates a user JWT, while:
    • The PlayFabId value from the response to the LoginWithTwitch request is written to the external_account_id parameter.
    • The SessionTicket value from the response to the LoginWithTwitch request is written to the session_ticket parameter.
  6. The user is redirected to the login_url with a token query parameter. The token parameter contains the user JWT.

Info: If the Twitch account is added to an already existing entry in the PlayFab database, the Xsolla database entry is updated in the same way.

Banning the User

You can ban the user via Publisher Account > your Login project > Users. The banned user will not be able to authenticate. The entry containing this information will only be written to the Xsolla database.

Who Can Use It

Partners who have already integrated Login.

How to Get It

  1. Go to Publisher Account > your Login project > General settings.
  2. In the User data storage block, select PlayFab.
  3. Enter a Title ID from your PlayFab account.
  4. Set up Twitch for user authentication:
    1. Register a Twitch account and get your Twitch Client ID.
    2. Go back to your Login project settings > Social connections.
    3. Enable Twitch.tv by specifying the Twitch Client ID in the Application ID field.
    4. Set up Twitch in your PlayFab account according to this instruction.
    5. If your integration of Xsolla Login is via API, please get a link for Twitch authentication and add an icon to your UI.

Info: You can use PlayFab methods to send additional emails.