Comment on page
Epic Games
Authenticate your players using Epic Games and register a session for them on the LootLocker backend.
The Epic Games platform needs to be enabled and configured in the Web Console before it can be used in your game.
To start using Sign in with Epic Games we first need to configure our integration in the platform settings.

Client ID
Client ID can be retrieved from the Epic Dev Console. If you don't have an Client, you will have to create one, more info here: https://dev.epicgames.com/docs/dev-portal/client-credentials
You need to acquire a Epic Identity Token to be able to start an Epic Games session, but once you have that, simply follow along to the code snippet below. In the response from LootLocker you will find a refresh token which can be used to refresh the session so that you do not need to do the full sign-in flow each time.
Unity
Unreal
REST
string idToken = "eyJhbGciOiJSUz............";
LootLockerSDKManager.StartEpicSession(idToken, (response) =>
{
if (!response.success)
{
Debug.Log("error starting LootLocker session");
return;
}
Debug.Log("session started successfully");
// Store these if you want to manually supply it to refresh the session without using the full sign in flow
string refreshToken = response.refresh_token;
});
Input
You need to exchange the
TriggerEpicSignIn
event for whatever event you want to use to trigger the login flow. Remove the node REPLACE: Epic ID Token
and replace it with your preferred method of getting the Epic Identity Token.Output
We recommend branching the completed events on the success flag, and if you do this you will probably want to add error handling in case the request fails as well as what (if any) continued actions you want on success. For subsequent calls to different LootLocker methods, you will want to create variables from the Player Id and Player Identifier outputs. In the session response when starting an Apple session you also get a refresh token that we will save under the hood. But if you want to use it manually, we provide it for you.
Beyond those three, there is a lot of interesting stuff in the session response, like current xp and level for example.
curl -X POST "https://api.lootlocker.io/game/session/epic" \
-H "LL-Version: 2021-03-01" \
-H "Content-Type: application/json" \
-d "{\"game_key\": \"your_game_key\", \"id_token\": \"eyJQa....\", \"game_version\": \"1.0.0.0\" }"
Example response:
{
"session_token": "eb13a7bf17efg36cb8481a8ds18809c7e85686e6",
"player_id": 9358,
"public_uid": "J72YP6MS",
"player_name": null,
"player_created_at": "2023-02-21T15:33:25+00:00",
"check_grant_notifications": false,
"check_deactivation_notifications": false,
"seen_before": true,
"refresh_token": "eyJh............................."
}
With Epic Games authentication, you can refresh the session instead of having the player do a full sign-in every time. The request will return a 401 (Unauthorized) if the refresh token has expired, in which case you will need to start a new session.
Unity
Unreal
REST
LootLockerSDKManager.RefreshEpicSession((response) =>
{
if (!response.success)
{
if (response.statusCode == 401) {
// Refresh token has expired, use StartEpicGamesSession
}
else {
Debug.Log("error starting LootLocker session");
}
return;
}
Debug.Log("session started successfully");
// Store these if you want to manually supply it to refresh the session without using the full sign in flow
string refreshToken = response.refresh_token;
});
Input
You need to exchange the
TriggerSessionRefresh
event for whatever event you want to use to trigger the login flow. The node Refresh Token
is the one you saved when starting a session, but it is optional as we save it behind the scenes as well.Output
We recommend branching the completed events on the success flag, and if you do this you will probably want to add error handling in case the request fails as well as what (if any) continued actions you want on success. For subsequent calls to different LootLocker methods, you will want to create variables from the Player Id and Player Identifier outputs. In the session response when starting an Apple session you also get a refresh token that we will save under the hood. But if you want to use it manually, we provide it for you.
Beyond those three, there is a lot of interesting stuff in the session response, like current xp and level for example.
curl -X POST "https://api.lootlocker.io/game/session/epic" \
-H "LL-Version: 2021-03-01" \
-H "Content-Type: application/json" \
-d "{\"game_key\": \"your_game_key\", \"refresh_token\": \"748b....\", \"game_version\": \"1.0.0.0\" }"
Example response:
{
"session_token": "eb13a7bf17efg36cb8481a8ds18809c7e85686e6",
"player_id": 9358,
"public_uid": "J72YP6MS",
"player_name": null,
"player_created_at": "2023-02-21T15:33:25+00:00",
"check_grant_notifications": false,
"check_deactivation_notifications": false,
"seen_before": true,
"refresh_token": "eyJh............................."
}
Congratulations - you have now started using LootLocker in your game with Sign in with Epic Games! Next up we suggest you look at our feature set, and decide which ones you want to use in your game.
Last modified 1mo ago