SDKs para Unity / Vinculação de contas
  Voltar aos Documentos

SDKs para Unity

Vinculação de contas

Vincule contas adicionais para entrar

If you configured multiple user authentication options in your application, you can implement the ability to link an additional social network account or username, email address, and password. This allows users to:

  • Use an alternative option to sign into the application, and not the one used during registration. For example, if a user used a device ID to log into the application for the first time, they can add a username, email address, and password and use these authentication details on the same or any other device.
  • Use a different account to sign into the application than the one they signed up with. For example, if the user specified a Google account when they first signed into the application, they can also link their Discord account and use their Google or Discord account to sign in.

To implement account linking:

  1. In the application UI, add forms for entering data for an additional account.
  2. Implement the linking logic using the following SDK methods:

SDK method nameDescription
AddUsernameEmailAuthToAccount
Adds a username, email address, and password, that can be used for authentication, to the current account.
LinkSocialProvider
Links a social network that can be used for authentication to the current account.
Observação
A social network account is automatically linked to an existing user account if the following conditions are met:
  • A user who signed up with a username/email address and password logged into your application via a social network account.
  • A social network provides access to the user’s email address.
  • User email address in a social network is the same as the email address used for sign-up in your application.

Vincular conta da plataforma

If you are distributing your game on different platforms, including Steam, Xbox Live, and Epic Games, you can implement the logic of linking platform accounts to a main user account. This allows users to:

  • have one game account for different platforms
  • use cross-inventory for synchronizing user inventories on different platforms

Fluxo de vinculação de contas

If the user has a main account, they can link a platform account to it during authentication on a platform:

  1. The user enters the game on the platform for the first time.
  2. The game UI shows a message that offers to link the platform account to their main account.
  3. The user launches the application and authenticates in their main account.
  4. The application sends a request for an account linking code to the Xsolla Login server.
  5. The application UI shows the user an account linking code.
  6. The user returns to the console version of the game and enters the code.
  7. The game server sends the request to link accounts to the Xsolla Login server.
  8. The console version of the game shows the confirmation message.

Observação
The platform account can’t be linked to another platform account, and you can’t unlink accounts from a main account.

Fluxo de implementação

  1. For an application build with a main account to which platform accounts will be linked:
    1. In Publisher Account, set up a standard Login project.
    2. Implement one of the user authentication options:
    1. In the application UI, add elements for requesting and showing an account linking code.
    2. Implement the logic of requesting the account linking code using the RequestLinkingCode SDK method and showing this code in the application UI.
  1. For the platform build:
    1. In Publisher Account, set up a shadow Login project.
Observação
Configuring a shadow Login project is similar to configuring a standard Login option. In step 4 of the setup instructions, select Shadow Login project.
    1. Implement one of the user authentication options:
Observação
Currently, silent authentication via the Steam, Xbox Live and Epic Games platforms is supported. If you need support for the Stone or Mail.ru platforms, contact your Account Manager.
    1. In the application UI, add elements for entering an account linking code.
  1. On the application server, implement the account linking logic using the Link accounts by code API call.

Este artigo foi útil?
Obrigado!
Podemos melhorar alguma coisa? Mensagem
Que pena ouvir isso
Explique porque este artigo não foi útil para você. Mensagem
Obrigado pelo seu feedback!
Avaliaremos sua mensagem e a usaremos para melhorar sua experiência.
Avalie esta página
Avalie esta página
Podemos melhorar alguma coisa?

Não quero responder

Obrigado pelo seu feedback!
Última atualização: 22 de Janeiro de 2024

Encontrou um erro de texto ou digitação? Selecione o texto e pressione Ctrl+Enter.

Relatar um problema
Nós sempre avaliamos nossos conteúdos. Seu feedback nos ajuda a melhorá-los.
Forneça um e-mail para que possamos responder
Obrigado pelo seu feedback!