# 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:

* [A game created in the LootLocker web console](/the-basics/readme.md)
* [UPA configured in the LootLocker web console](https://github.com/lootlocker/gitbook-sync/blob/main/players/unified-player-accounts/how-to/README.md)
* [A player with an active LootLocker game session](/players/authentication.md)

## 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!](https://lootlocker.com/contact)

{% tabs %}
{% tab title="Unity" %}

```csharp
// 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");
});
```

{% endtab %}

{% tab title="Unreal" %}

<figure><img src="/files/DEqTe5EhOLwroIhFJcmw" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/i0rj-nc4/">Blueprint example of connecting Apple account</a></p></figcaption></figure>
{% endtab %}

{% tab title="REST" %}
Specific reference for providers are here:

* [Apple](https://ref.lootlocker.com/game/upa/connected-accounts/connect-apple-account)
* [Google](https://ref.lootlocker.com/game/upa/connected-accounts/connect-google-account)

The following example is for Apple:

```bash
curl -X PUT "https://api.lootlocker.io/game/v1/connected-accounts/apple-rest" \
    -H "x-session-token: your_token_here" \
    -H "Content-Type: application/json" \
    -d '{"authorization_code": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.0.xxxxx.xxxxxxxx-xxxxxxxxxxxxx"}'
```

{% endtab %}
{% endtabs %}

## 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](/players/unified-player-accounts/how-to/disconnect-provider.md) or our general [Unified Player Account](/players/unified-player-accounts.md) documentation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lootlocker.com/players/unified-player-accounts/how-to/connect-provider-to-player.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
