Links

White Label Login

White Label Login provides a way for you to have an email/password login not tied to any of the big platforms.
This is great for more advanced use cases, like making it possible for your players to sign in on your website with the same account they're using in the game.
Before using the SDK you must first enable and configure the White Label Login in Platform Settings

Create a New User

Before we can register a session in the game, a user must first be created.
Passwords must be at least 8 characters long.
Unity
Unreal
// Remember to use the LootLocker namespace in the top of your file.
using LootLocker.Requests;
// This code should be placed in a handler when user clicks the sign up button.
string email = "[email protected]";
string password = "password here";
LootLockerSDKManager.WhiteLabelSignUp(email, password, (response) =>
{
if (!response.success)
{
Debug.Log("error while creating user");
return;
}
Debug.Log("user created successfully");
});
White Label Login is not yet implemented in the Unreal SDK.
If you need this feature, please let us know on our Discord server.

Logging in the User

White label login works a little differently than other platforms in the sense that we first have to create a white label login session, which is then used to create a game session.
When the player is logged in, the SDK will save the token, so you don't have to send it to StartWhiteLabelSession
Unity
Unreal
// Remember to use the LootLocker namespace in the top of your file.
using LootLocker.Requests;
// This code should be placed in a handler when user clicks the login button.
string email = "[email protected]";
string password = "password here";
bool rememberMe = true;
LootLockerSDKManager.WhiteLabelLogin(email, password, rememberMe, response =>
{
if (!response.success)
{
Debug.Log("error while logging in");
return;
}
string token = response.SessionToken;
// Start game session here
});
White Label Login is not yet implemented in the Unreal SDK.
If you need this feature, please let us know on our Discord server.

Handle Returning Player

We don't want a player to have to type in their email and password every time they start the game, so for this we can re-use the session token provided by the WhiteLabelLogin call multiple times.
By default a session token is good for 24 hours, but if you send remember me to true a session will last for 30 days. Remember that these sessions are disconnected from the game session, so you still want to create a game session every time the player opens your game.
The length of a remember session can be changed in platform settings for White Label Login.
When a player opens the game we first want to check if they have a previous session we can use:
Unity
// Remember to use the LootLocker namespace in the top of your file.
using LootLocker.Requests;
LootLockerSDKManager.CheckWhiteLabelSession(response =>
{
if (response)
{
// Start a new session
Debug.Log("session is valid, you can start a game session");
}
else
{
// Show login form here
Debug.Log("session is NOT valid, we should show the login form");
}
});
Depending on the response from this code we can either show the login form and ask for email and password again or we can start a game session.

Register a Game Session

After creating a session token we can register a game session. When the session has been registered you can use other LootLocker features in your game.
Unity
Unreal
// Remember to use the LootLocker namespace in the top of your file.
using LootLocker.Requests;
// This code should be placed in a handler when user clicks login button.
LootLockerSDKManager.StartWhiteLabelSession((response) =>
{
if (!response.success)
{
Debug.Log("error starting LootLocker session");
return;
}
Debug.Log("session started successfully");
});
To learn more about sessions you can read our page on Understanding the Session Registration Response
White Label Login is not yet implemented in the Unreal SDK.
If you need this feature, please let us know on our Discord server.

Request Password Reset

If they user wants to reset their password we can use the following code to send them an email with a link to a reset password page.
The page is hosted on LootLocker and will use the settings in Platform Settings for name and logo.
Unity
Unreal
// Remember to use the LootLocker namespace in the top of your file.
using LootLocker.Requests;
// This code should be placed in a handler when user clicks reset password.
string email = "[email protected]";
LootLockerSDKManager.WhiteLabelRequestPassword(email, (response) =>
{
if (!response.success)
{
Debug.Log("error requesting password reset");
return;
}
Debug.Log("requested password reset successfully");
});
White Label Login is not yet implemented in the Unreal SDK.
If you need this feature, please let us know on our Discord server.