Connect user data storage

Depending on the method of storing user data, different product functionality is available to you (see Comparison of user data storage options).

Xsolla storage

If you want the Login product to process all authentication logic, connect to Xsolla storage. More flexible settings will be available to you.

When you create a Login project, Xsolla storage is connected by default, no additional steps are required to configure it. If you have changed the default storage type and need to reconnect to Xsolla storage, follow these steps:

  1. Go to the User database block and select the Storage section.
  2. Select Xsolla storage and click Save changes.

Note
Xsolla storage supports JWT standard-based and OAuth 2.0 protocol-based authentication. All user information is stored on Xsolla’s side.

PlayFab storage

If you want to use PlayFab functionality to work with users, connect to PlayFab storage. The storage saves the following user data:

  • username
  • user email address
  • user password
  • fields from an extended registration form if the form is set up

Note
PlayFab storage supports JWT standard-based and OAuth 2.0 protocol-based authentication.

PlayFab storage gives you access to the following features:

  • user registration
  • authentication by email address or username and password
  • authentication via Twitch
  • user password reset
  • user blocking

To connect the storage:

  1. Go to the User database block and select the Storage section.
  2. Select PlayFab.
  3. In the Title ID field, enter the value of the same field from your PlayFab account.
  4. Click Save changes.

Note
All user information is stored on Xsolla’s side. User passwords are verified by PlayFab only.

Firebase storage

If you want to use Firebase functionality to work with users, connect to Firebase storage. This storage saves the following user data:

  • username
  • user email address
  • user password
  • fields from an extended registration form if the form is set up

Note
Firebase storage supports JWT standard-based and OAuth 2.0 protocol-based authentication.
To connect the storage:
  1. Go to the User database block and select the Storage section.
  2. Select Firebase.
  3. In the API key field, enter the value of the same field from your Firebase account.
  4. Click Save changes.
Note
All user information is stored in the JSON format and is updated in real time with every connected client.

Custom storage

If you use your own authorization system and store user data on your application side, connect to custom storage.

The custom storage gives you access to the following features:

  • user registration
  • authentication by email address or username and password
  • passwordless authentication by phone number
  • authentication via social networks
  • user password reset

Note
Custom storage supports JWT standard-based authentication.
To set up the connection between the Xsolla Login server and your application as a client:
  1. Connect the custom storage.
  2. Set up the processing of requests from the Xsolla Login server.
Note
All user information is stored on Xsolla’s side. User passwords are verified by the custom storage only.

Connect custom storage

  1. Go to the User database block and select the Storage section.
  2. Select Custom storage.
  3. Enter URLs where to send API requests:
  4. Click Save changes.
  5. For the URLs you have set, implement an API that will respond as follows:
    • HTTP 200 / HTTP 204 for successful requests. If required, a JSON containing additional user data can be placed in the response body. The passed data is written to a JWT (the partner_data parameter).
    • Other HTTP status codes for unsuccessful requests.
Note
  • If you want the JWT to contain the user ID from your database, contact your Customer Success Manager or email to csm@xsolla.com.
  • For passwordless authentication via a phone number to work correctly, your API response must contain the account_id parameter that matches the user ID from the client.

Set up processing of requests from Xsolla Login server

Xsolla Login server requests are sent to URLs, you specified in Publisher Account, with the Authorization: Bearer <JWT> header. The JWT is signed with the secret key of your project.

To process a request:

  1. Validate a received JWT.
  2. If the validation is successful, decode the JWT and make sure it includes the claims from the table below. Find and use a library for decoding.

ClaimTypeDescription
expUnix TimestampThe date and time of the JWT expiry. The JWT lifetime is 7 minutes.
iatUnix TimestampThe date and time JWT is issued.
issstringThe service that signed the JWT: https://login.xsolla.com.
request_typestringConstant: gateway_request.
xsolla_login_project_idstring (UUID)Your Login project ID in Publisher Account.
Example of a token payload:
Copy
Full screen
Small screen
{
  "exp": 1573635020,
  "iat": 1573634600,
  "iss": "https://login.xsolla.com",
  "request_type": "gateway_request",
  "xsolla_login_project_id": "00000000-0000-0000-0000-000000000000"
}
Your progress
Thank you for your feedback!

Continue reading

Last updated: October 10, 2023

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!