Are the restrictions applied by Xsolla API on the frequency of access by a user within a defined timeframe.
Standard Login project
Is a Login project that is used to store main accounts.
Shadow Login project
Is a Login project that is used to store platform accounts.
Main account
Is an account type that is created in a standard Login project and linked to platform accounts. The main account is used to identify the player on different platforms.
Platform account
Is an account type that is created in a shadow Login project and connected to a definite publishing platform. The platform account can't be linked to another platform account. Also, you can't unlink the accounts from a main account.
Publishing platform
Is a game platform that is used for game distribution (e.g. Steam, PlayStation, Xbox, etc.).
Authentication
Login API supports the following token types:
User token. It is used for sending requests to the following user resources:
profile
friends
attributes
Server token. It is used for sending requests to application resources such as settings or user data. The following requests are available:
You can determine whether an API call is client or server-side by the scheme of authentication:
Client-side — are called without authentication or with the Authorization header: Bearer <user_JWT> header, where <user_JWT> — is the user token.
Server-side API calls for implementing the user flow — are called with the header: X-SERVER-AUTHORIZATION: <server_JWT>, where <server_JWT> — is the server token.
Getting a user token
To get the token, send one of the following requests:
After JWT authentication, the user is redirected to the Callback URL with a token in a query-parameter: <Callback URL>?token=<User token (JWT)>.
After OAuth 2.0 protocol-based authentication, send the Generate JWTPOST request to the Xsolla Login server to exchange the received code parameter for a user token (access_token).
When the access token expires, the client sends Generate JWTPOST request endpoint on the Xsolla Login server. The request body must include the following parameters:
grant_type — JWT grant type, pass the refresh_token value.
client_id — OAuth 2.0 client ID.
refresh_token — refresh token received in response to the user authorization request.
Go to the Security block and select the OAuth 2.0 section.
Click Add OAuth 2.0 Client.
Check the Server (server-to-server connection) box.
Specify Token lifetime.
Click Connect.
Copy and save the client ID and secret key.
Generate server JWT
On the back end of your application, implement a method to get the server JWT using the Generate JWT API call. The request must contain the following parameters:
grant_type is the type of getting JWT, pass the client_credentials value.
client_secret is the secret key that is received when you set up the server OAuth 2.0 client.
client_id is the client ID received when you set up the server OAuth 2.0 client.
When the server token expires, generate a new token using the Generate JWT API call. The request body must include the following parameters:
grant_type — JWT grant type, pass the client_credentials value.
client_id — OAuth 2.0 client ID.
client_secret — OAuth 2.0 client secret key.
Rate limits
To prevent Xsolla system overloads and protect against sudden spikes in incoming traffic, Xsolla limits the number of requests received by the Xsolla API within a specified period of time. If the limit is exceeded, the Xsolla API returns an HTTP response with the 429 status code.
Rate limits vary by method, IP-address, authentication scheme, and other factors.
Rate limits for server-side methods are applied to methods with server-side authentication — methods that are called with the X-SERVER-AUTHORIZATION: <server_JWT> header, where <server_JWT> is the server token.
Rate limits for client-side methods are applied to methods without authentication or with client-side authentication — methods that are called with the Authorization: Bearer <user_JWT> header, where <user_JWT> is the user token.
Example of a method with server-side authentication:Example of a method with client-side authentication:
Rate limits for client-side methods do not change and are necessary to prevent brute-force attacks. The maximum request rate for server-side methods is higher than for client-side methods. You can refer to the recommendations on how to manage rate limits in the documentation.
Note
In certain cases, it is possible to adjust the rate limits by request. To request the rate limits adjustment, contact your Customer Success Manager or email csm@xsolla.com.
JWT structure
Every token has a JWT format and contains a definite information in a payload.
User JWT
User JWT is a token received as a result of authentication or registration. A token payload contains information about the user and authentication call.
Getting a user token via the OAuth 2.0 protocol requires an OAuth 2.0 client. The user token is passed in the Authorization: Bearer <JWT> header.
Main claims
A token will contain the main claims after authentication or email address confirmation. Presence of these claims does not depend on the user database and authentication call.
List of groups the user is in. Each group: id — group ID; name — group name; is_default — whether the group is default (true or false). There can be only one default group, which initially includes all users before they are distributed into different groups.
xsolla_login_project_id
string (UUID)
Yes
Login project ID.
type
string
Authentication option: xsolla_login — login via username/email and password; social — social login; email — passwordless login via one-time code by email; phone — by SMS; firebase — Firebase storage; playfab — PlayFab storage; proxy — custom storage; device — device ID; server_custom_id — custom ID.
avatar
string
User avatar URL.
username
string
Username.
publisher_id
integer
ID of a merchant who owns a Login project.
email
string
User email address.
payload
string
Additional information that is passed in the payload parameter during authentication.
promo_email_agreement
boolean
true if the user agrees to receive a newsletter, false otherwise. Default: true. To add to the Login widget registration form: contact your Account Manager (Widget 2.0) or add the fields parameter with the promo_email_agreement value to the initialization code (previous widget version).
connection_information
string
Shows whether the user confirmed their birth date or not. Confirmation is made via the okname service.
PlayFab storage
Claims that are contained in the token after authentication if you use PlayFab storage.
Claim
Type
Required
Description
external_account_id
string
Yes
User PlayFab ID.
session_ticket
string
Yes
A SessionTicket parameter received during an authentication request or requests to the PlayFab API. A token contains the claim if you authenticate users via the OAuth 2.0 protocol and pass the playfab value to the scope parameter.
entity_token
string
Yes
An EntityToken.EntityToken parameter.
entity_type
string
Yes
An EntityToken.Entity.Type parameter. Can have only the title_player_account value.
entity_id
string
Yes
An EntityToken.Entity.Id parameter.
Custom storage
Claims that are contained in the token after authentication if you use custom storage.
Claim
Type
Required
Description
provider
string
Yes
Name of a social network used for authentication. If the user authenticates via username and password, the claim has the xsolla value.
external_account_id
string
User ID on your server side.
partner_data
Data of any type returned by your server in the response body during authentication. To enable the transmission of this claim, contact your Customer Success Manager or email csm@xsolla.com.
social_access_token
Access token of the social network through which the user was authenticated. To enable the transmission of this claim, contact your Customer Success Manager or email csm@xsolla.com.
Social authentication
Claims that are contained in the token after authentication via a social network. Presence of these claims does not depend on the user database.
Claim
Type
Required
Description
provider
string
Yes
Name of a social network used for authentication.
id
string
Yes
User ID in a social network.
is_cross_auth
boolean
Shows that the silent authentication request is in progress.
social_access_token
string
Social network account access_token parameter used for authentication. Contact your Account Manager to set up the feature.
picture
string (URL)
Link to the user profile picture in a social network.
Claims that are contained in the token after OAuth 2.0 authentication.
Claim
Type
Required
Description
jti
string
Yes
Unique token ID.
Authentication via a phone number
Claim which is contained in the token after authentication via a phone number.
Claim
Type
Required
Description
phone_number
string
Yes
User's phone number used for authentication. The phone number format based on the country code, area code, and line number without any dividers.
Server JWT
The server token is passed in the X-SERVER-AUTHORIZATION header.
The token payload contains information about resources owned by the OAuth 2.0 client. The token has access to calls with server-based authentication for these resources.
Claim
Type
Required
Description
xsolla_login_project_id
string (UUID)
Yes
ID of a Login project that owns the OAuth 2.0 client.
resources
array
Yes
List of resources owned by an OAuth 2.0 client. Possible types: publisher_id — resources of a merchant who owns the Login project; publisher_project_id — resources of a project in Publisher Account. Each resource: name — resource type; value — resource ID.
jti
string
Yes
Unique token ID.
JWT validation
To validate the JWT, use the following Login API calls:
Project ID from Publisher Account which you make a request for.
If you specify it, but do not specify project_id parameter, service will be found linked to its project_id. Contact your Customer Success Manager to link project_id to publisher_project_id.
Example: 12423354
usersArray of objects<= 50 itemsrequired
Social ID and platform for which it is needed to get user ID.
Example: [{"platform":"xbox","user_id":4352354}]
users[].platformstringrequired
Name of chosen Social Provider. Can be steam, xbox, epicgames, psn.
Searches users by the nickname parameter and gets a list of them. Search can be performed instantly when the user starts entering the search parameter.
The workflow of using this call:
The user enters a nickname or tag, or nickname and tag.
The Xsolla Login server searches for users in the Login project data of the user who initiated a search.
The current user can execute this call only one time per second.
Claims that are contained in the token after authentication via a social network. Presence of these claims does not depend on the user database.
provideridis_cross_authsocial_access_tokenaccess_tokenparameter used for authentication. Contact your Account Manager to set up the feature.picturebirthdaygendername