Connect Identiy Provider to Player

In this how-to we'll explain how to connect an additional identity provider to a player's account. This can be useful if the player wants to play from multiple devices, or if you want to offer the player the option to authenticate with different providers.

Prerequisites

Before we begin, ensure you have the following:

Connect Provider

In order to connect an additional provider to the player, the general flow is as follows:

  • Have the player signed in with an active LootLocker session on the game client

  • Connect the provider to the player's LootLocker account, using the token from the authentication

Getting the authentication token is different for each provider, but the general idea is the same. In this example we'll use Apple sign in, but you can exchange this with another provider.

The following providers are currently supported:

  • Apple Sign In

  • Google Sign In

If you're interested in support for other identity providers, please reach out to us!

// The token retrieved from authenticating with Apple in the game client
string token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.0.xxxxx.xxxxxxxx-xxxxxxxxxxxxx";
LootLockerSDKManager.ConnectAppleAccount(token, (response) =>
{
    if(!response.success)
    {
        Debug.Log("Error connecting Apple");
        return;
    }

    Debug.Log("Successfully connected Apple");
});

Conclusion

In this how-to we've added an additional provider to a player's account, making it possible for them to authenticate with multiple different providers.

If you want to learn more, you can read about how to disconnect a provider or our general Unified Player Account documentation.

Last updated