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:
- Go to the User database block and select the Storage section.
- Select Xsolla storage and click Save changes.
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
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:
- Go to the User database block and select the Storage section.
- Select PlayFab.
- In the Title ID field, enter the value of the same field from your PlayFab account.
- Click Save changes.
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
- Go to the User database block and select the Storage section.
- Select Firebase.
- In the API key field, enter the value of the same field from your Firebase account.
- Click Save changes.
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
Connect custom storage
- Go to the User database block and select the Storage section.
- Select Custom storage.
- Enter URLs where to send API requests:
- Click Save changes.
- 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.
- 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
- 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:
- Validate a received JWT.
- 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.
Claim | Type | Description |
---|---|---|
exp | Unix Timestamp | The date and time of the JWT expiry. The JWT lifetime is 7 minutes. |
iat | Unix Timestamp | The date and time JWT is issued. |
iss | string | The service that signed the JWT: https://login.xsolla.com . |
request_type | string | Constant: gateway_request . |
xsolla_login_project_id | string (UUID) | Your Login project ID in Publisher Account. |
- json
{
"exp": 1573635020,
"iat": 1573634600,
"iss": "https://login.xsolla.com",
"request_type": "gateway_request",
"xsolla_login_project_id": "00000000-0000-0000-0000-000000000000"
}
Continue reading
Found a typo or other text error? Select the text and press Ctrl+Enter.