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:

  1. Retrieval of a one-time password.
  2. Adding the one-time password to the installer’s name.
  3. 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.

Note
If the tracking_payload parameter is used, its value cannot be empty.
Notice
This functionality is only available if you have connected OAuth 2.0 authentication.

Example of a request to retrieve a one-time password using Xsolla Login:

Copy
Full screen
Small screen

    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:

    Copy
    Full screen
    Small screen

      curl
      -X POST
      "https://launcher.xsolla.com/otp?tracking_payload=<tracking_payload>"
      -H
      "accept: application/json"
      -H
      "Content-Type: application/json"

      Note
      If the 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.

      Copy
      Full screen
      Small screen

        game.exe --tracking_payload <tracking_payload> WU9VUiBEQVRBIEhFUkU=

        Note
        The launcher sends user data to the game every time the game is started.
        Was this article helpful?
        Thank you!
        Is there anything we can improve? Message
        We’re sorry to hear that
        Please explain why this article wasn’t helpful to you. Message
        Thank you for your feedback!
        We’ll review your message and use it to help us improve your experience.
        Rate this page
        Rate this page
        Is there anything we can improve?

        Don’t want to answer

        Thank you for your feedback!
        Last updated: February 4, 2021

        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!