How to enable seamless authorization
How it works
When a user is logged in to a website that distributes a launcher, the launcher account is automatically logged in, and you can transfer user data from the website to the game through the launcher.
How to get it
To enable seamless authorization, implement the following:
- Retrieval of a one-time password.
- Adding the one-time password to the installer’s name.
- Processing of user data transmitted to the game (optional).
Retrieval of a one-time password
To implement retrieval of a one-time password:
- If you use Xsolla Login, implement a POST request to the
https://launcher.xsolla.com/otp
URL. In the request body, pass a JSON with the following parameters:refresh_token
- user refresh token.access_token
- user access token.tracking_payload
- user data that needs to be transferred to the game. The maximum length of the string is 255 characters.
tracking_payload
parameter is used, its value cannot be empty.Example of a request to retrieve a one-time password using Xsolla Login:
curl -X POST "https://launcher.xsolla.com/otp" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"access_token\": \"string\", \"refresh_token\": \"string\", \"tracking_payload\": \"string\"}"
- If you are not using Xsolla Login, send the user data that needs to be transferred to the game in the
tracking_payload
query parameter. The maximum length of the string is 255 characters.
Example of a request to retrieve a one-time password if Xsolla Login is not used:
curl
-X POST
"https://launcher.xsolla.com/otp?tracking_payload=<tracking_payload>"
-H
"accept: application/json"
-H
"Content-Type: application/json"
tracking_payload
parameter is used, its value cannot be empty.Adding the one-time password to the installer’s name
The received one-time password is a 36-character string in UUID format. Implement adding the one-time password to the installation file name when downloading in the following format: LauncherName_<OTP>.exe
, where <OTP>
is the one-time password.
Retrieval of user data by the game
The launcher passes the data received in the tracking_payload
parameter as the value of the command line argument --tracking_payload
, as shown in the example below.
game.exe --tracking_payload <tracking_payload> WU9VUiBEQVRBIEhFUkU=
Was this article helpful?
Rate this page
Don’t want to answer
Thank you for your feedback!
Found a typo or other text error? Select the text and press Ctrl+Enter.