SDK de nivel empresarial para Unity / Autenticación a través del lanzador de aplicaciones
  Volver a Documentos

SDK de nivel empresarial para Unity

Autenticación a través del lanzador de aplicaciones

If you use Xsolla Launcher or Steam to deliver your application to users, you can automatically authenticate the user using the launcher’s credentials.

Instrucciones

Learn about advanced setups from our how-tos.

Cómo establecer la autenticación en la aplicación mediante Launcher

You can use Xsolla Launcher to deliver your application to users and update it. The Launcher contains a built-in authorization tool. To avoid the need to re-enter username and password, set up authorization in your application via the Launcher.

Aviso
To use the Launcher, you need to configure Login. Using a different authorization system is not supported.

Configurar el SDK y Launcher para que funcionen juntos

  1. Set up Launcher in your Publisher Account.
Nota
In the config.json file, it is enough to change the values for the following objects:
  • launcher_project_id — specify Launcher ID found in Publisher Account > Launcher > General settings > General info
  • login_project_id — specify Login ID found in Publisher Account > Launcher > General settings > Authentication
  1. Customize the launcher UI.
Aviso
SDKs integration with Xsolla servers uses IGS & BB API calls, so the Launcher store is not supported.
  1. Implement the Launcher authorization logic in your application.
  2. Generate a launcher installation file and a build archive.
  3. Create an application build.
  4. Upload the application build to the Xsolla update server.

Implementar la lógica para la autenticación mediante Launcher

The flow for authorization in the application via Launcher is as follows:

  1. The user is authorized in Launcher.
  2. The user installs and runs the application.
  3. Launcher runs the application and passes user parameters via the command line. The authorization token is passed in the xsolla-login-token parameter.
  4. The application processes command line parameters and obtains a token. An example of a token processing script can be viewed in the demo project.
  5. The application validates the received token. An example of a token validation script can be viewed in the demo project.
  6. The application automatically authorizes the user without displaying an authorization page. An example of a user authorization script can be viewed in the demo project.

Nota
The obtained token is used by SDK methods to open an in-game store, make a payment, etc. Pass the token to the Token.Instance property.

Crear una compilación de la aplicación

  1. Go to your Unity project.
  2. Click Window > Xsolla > Edit Settings in the main menu. In the Inspector panel:
    1. In the Project ID field, specify the Project ID found in Publisher Account > Project settings > Project ID.
    2. In the Login ID field, specify the Login ID found in Publisher Account > Launcher > General settings > Authentication.
  1. Run the user authorization scene, where the token is processed.
  2. Click File > Build settings in the main menu and then click Add Open Scenes. Make sure the authorization scene is added first in the list.
  3. Click Build.
  4. In the pop-up window, specify the path to the directory where the finished build will be placed.
¿Te ha resultado útil este artículo?
¡Gracias!
¿Hay algo en lo que podamos mejorar? Mensaje
Lo sentimos
Por favor, cuéntanos por qué no te ha resultado útil este artículo. Mensaje
¡Gracias por tu mensaje!
Nos ayudará a mejorar tu experiencia.
Ocultar

Cómo configurar la autenticación nativa a través de Steam

Aviso
Use this how-to guide if you included the demo project in your Unity project.

Native authentication allows players to enter your application via the installed Steam application.

To set up native authentication:

  1. Set up silent authentication via Steam in Publisher Account.
  2. Configure your Unity project.
  3. Configure processing of events.
  4. Ensure authentication via Steam.

Configurar su proyecto de Unity

  1. Create a steam_appid.txt file and enter your application ID in Steam there. Then, place this file in the Assets/Plugins/Steamworks.NET/redist/ catalog of your project.
Nota
If you downloaded the SDK from GitHub, you can find the steam_appid.txt file in the Assets/Plugins/Steamworks.NET/redist/ catalog. This file includes the application ID in Steam for a demo project.
  1. Open your Unity project.
  2. In the main menu, go to Window > Xsolla > Demo Settings.
  3. In the Inspector panel:
    1. Check the Use Steam authorization box.
    2. In the Steam App ID field, specify your application ID in Steam. The value should be the same as the value in the steam_appid.txt file.

Configurar el procesamiento de los eventos

To authenticate users via Steam, you should pass a session ticket to the SilentAuth method. For an example, see the SteamAuth.cs class of the demo project.

Garantizar la autenticación a través de Steam

  1. Create the build of your Unity project for a stand-alone platform or start a scene.
  2. Launch Steam and log in.
  3. Launch your application. If everything is correct, you will be logged into the applictaion automatically.
¿Te ha resultado útil este artículo?
¡Gracias!
¿Hay algo en lo que podamos mejorar? Mensaje
Lo sentimos
Por favor, cuéntanos por qué no te ha resultado útil este artículo. Mensaje
¡Gracias por tu mensaje!
Nos ayudará a mejorar tu experiencia.
Ocultar
Última actualización: 10 de Octubre de 2023

¿Has encontrado una errata u otro error de texto? Selecciona el texto y pulsa Ctrl+Intro.

Informar de un problema
Nos esforzamos por ofrecer contenido de calidad. Tus comentarios nos ayudan a mejorar.
Déjanos tu correo electrónico para que te podamos responder
¡Gracias por tu mensaje!