This how-to links an existing Steam account with a new Epic Games account using authentication through auth.game.
The overall flow is:
- The player starts the linking process in the game client.
- The game client redirects the player to the LootLocker authentication website (auth.game).
- The player signs in with the provider they want to add to their account.
- The game client polls the server to check if the player has completed the web flow yet.
- Once the player has completed the web flow, the game client links the new provider to the existing account.
Prerequisites
Start Link Flow
Start in the game client by initiating the link flow. This generates a URL the player can use to authenticate with the provider.
Coming soon — this sample hasn't been written yet.
Coming soon — this sample hasn't been written yet.
Coming soon — this sample hasn't been written yet.
Specific reference: Begin Remote Session Link Lease.
curl --location --request POST 'https://api.lootlocker.com/game/session/remote/link/lease' \ --header 'x-session-token: your_token_here' \ --header 'Content-Type: application/json' \ --data-raw '{ "game_key": "your_api_key_here", "game_version": "1.0.0.0" }'Poll for Link Status
While the player is authenticating with the provider, poll the server to check if they've completed the web flow yet. A polling interval of 2–3 seconds is recommended.
Coming soon — this sample hasn't been written yet.
Coming soon — this sample hasn't been written yet.
Coming soon — this sample hasn't been written yet.
Specific reference: Begin Remote Session Link Lease.
curl --location --request POST 'https://api.lootlocker.com/game/session/remote/link/lease' \ --header 'x-session-token: your_token_here' \ --header 'Content-Type: application/json' \ --data-raw '{ "game_key": "your_api_key_here", "game_version": "1.0.0.0" }'Handle Link Results
Once the player has completed the web flow, the endpoint you've been polling returns a success response with a LootLocker session.
There are two main scenarios:
- The provider they authenticated with doesn't exist on another LootLocker account.
- The provider they authenticated with already exists on another LootLocker account.
Handle the response differently depending on the scenario. The following example handles the first scenario, where the provider doesn't exist on another LootLocker account.
Coming soon — this sample hasn't been written yet.
Coming soon — this sample hasn't been written yet.
Coming soon — this sample hasn't been written yet.
Specific reference: Transfer Providers.
The provider name is returned in the poll response.
curl --location --request PUT 'https://api.lootlocker.io/game/v1/connected-accounts/transfer-providers' \ --header 'Content-Type: application/json' \ --data-raw '{ "source_token": "session_token_from_game_client_here", "target_token": "session_token_from_poll_response_here", "identitiy_providers": [ "provider_name_here", ] }'In the second scenario, where the provider already exists on another LootLocker account, the flow needs to be handled differently. The steps for moving the provider to the new account are the same as above, but make sure the player understands they're moving the provider to a different account, and that they might lose access to the old account. In some games, you might even want to migrate data from the old account to the new one.
This is a more complex flow — we recommend reaching out to us for help with this.
Conclusion
You've linked an existing account with a new provider through auth.game. To learn more, read the general Unified Player Accounts documentation.