LootLocker
The BasicsGame SystemsContent ManagementPlayer Management
LootLocker
  • 📌The Basics
    • Getting Started
    • What is LootLocker?
    • Core Concepts
      • Players
      • Assets
      • Character Classes
      • API Types
      • Web Console
      • Stage & Live Environments
      • Glossary
    • Unity Quick Start
      • Install the SDK
      • Configure the SDK
      • Authenticate Your First Player
      • Update the SDK
    • Unreal Quick Start
      • Install & Configure the SDK
        • Older versions
      • Authenticate Your First Player
    • Godot Quick Start
      • Install the SDK
      • Configure the SDK
      • Authenticate Your First Player
      • Update the SDK
    • SDKs
    • Samples
      • Authentication Samples
      • Leaderboard Samples
      • Progression Samples
      • Player Samples
    • Launching Your Game
    • Support
      • Error Codes
      • Unreal Marketplace Plugin Support
  • 🎭Players
    • Overview
    • Authentication
      • How To
        • Guest Login
        • Steam
        • Apple
        • Apple Game Center
        • Google
        • Epic Games
        • PlayStation
        • Meta / Oculus
        • Xbox
        • Nintendo Switch
    • Files
      • How To
        • Manage Files in Web Console
        • Work with Files In-Game
    • Inventory
      • How To
        • Work with Player Inventory
    • Messages
      • How To
        • Configure Messages in Web Console
    • Names
      • How To
        • Work with Player Names
    • Player Manager
      • How To
        • Manage Players through Web Console
        • Manage Players In-Game
        • Use Player Operations
    • Unified Player Accounts
      • How To
        • Configure UPA in Web Console
        • Use Remote Login In-Game
        • Connect Identiy Provider to Player
        • External Provider Linking
        • Transition from Guest Login to Other Provider
        • Disconnect Identity Provider from Player
    • White Label Login
      • How To
        • Configure White Label Login
        • Create a New White Label User
        • Request User Verification
        • Handle Returning Users
        • Start a White Label Session
  • 🪙Commerce
    • Overview
    • Catalogs
      • How To
        • Configure Catalogs in LootLocker Console
        • List all Catalogs
        • Use Catalogs In-Game
        • Setup In-Game Store
    • Currencies
      • How To
        • Configure a Currency in Web Console
        • Use Currencies In-Game
    • DLC Management
      • How To
        • Configure DLC in Web Console
        • Use DLC In-Game
    • Entitlements
      • How To
        • Work with Entitlements In-Game
    • Real Money Purchases
      • How To
        • Configure In-App Purchase in Web Console
        • Make Purchases through Google Play Store
        • Make Purchases through Apple Store
        • Make Purchases through Steam Store
    • Virtual Purchases
    • Wallets
      • How To
        • Manage a Wallet in Web Console
        • Use Wallets In-Game
  • ⚔️Content
    • Overview
    • Assets
      • How To
        • Create & Configure an Asset
        • Organize & Search for Assets
        • Retrieve Assets In-Game
        • Set up Asset Storage Template
        • Check Grant Notifications
        • Set up a Game Config Asset
        • Create a Loot Box
        • Work with Loot Boxes In-Game
        • Create a Drop Table
        • Work with Drop Tables In-Game
        • Create a Rental Asset
        • Work with Rental Assets In-Game
    • User Generated Content (UGC)
      • How To
        • Create UGC In-Game
    • Twitch Drops
  • 🕹️Game Systems
    • Overview
    • Classes & Heroes
      • How To
        • Base Classes
        • Hero Classes
        • Implement Classes In-Game
        • Implement Heroes In-Game
    • Leaderboards
      • How To
        • Configure Leaderboard in Web Console
        • Use Player Leaderboards
        • Use Generic Leaderboards
        • Use Metadata to Store Additional Information
        • Use Scheduled Reset with Rewards
        • Use Leaderboards for Time Based Rankings
      • Leaderboard FAQ
      • GameMaker References
    • Feedback
      • How To
        • Manage Feedback Categories
        • Create Player Feedback
        • Create UGC Feedback
        • Create Game Feedback
        • View and Manage Feedback
    • Progressions
      • How To
        • Create a Progression
        • Game Progressions
        • Player Progressions
        • Class Progressions
        • Asset Instance Progressions
    • Triggers
      • How To
        • Setup a trigger in the Web Console
        • Invoke trigger from game
  • ⛓️Shared Systems
    • Overview
    • Metadata
      • How To
        • Add Metadata in Console
        • Fetch a Single Metadata In-Game
        • Fetch Metadata In-Game by Tags
        • Fetch Metadata In-Game from Multiple Sources
    • Notifications
      • How To
        • List Notifications and Mark as Read In-Game
  • 🗝️Admin
    • Settings
    • User Settings
    • Organization Settings
    • CORS Allowlist
  • ⭕️ Legacy
    • Deprecations
      • Unity SDK Deprecation Log
        • Version 2.1.5 - Migration to Open UPM
        • Version 2.0.0
      • Unreal SDK Deprecation Log
        • Version 4.0.0
        • Version 3.0.0
    • Legacy Storage
    • Legacy Triggers
      • Activate a trigger
      • Create a trigger
    • Legacy Progressions
      • Create a Progression System
      • Use a Progression System In-Game
Powered by GitBook
On this page
  • Pre-requisites
  • The Remote Login Flow
  • Starting a Remote Session
  • Cancel the remote login process
  • Use the Refresh Token to Start a Session
  • Conclusion
  1. Players
  2. Unified Player Accounts
  3. How To

Use Remote Login In-Game

PreviousConfigure UPA in Web ConsoleNextConnect Identiy Provider to Player

Last updated 5 months ago

Remote login makes it easy to start LootLocker sessions on devices where it's hard to enter their credentials, like on console. It also enables games to easily implement 1st party provider authentication without having to spend a long time manually implementing it into their game client.

Pre-requisites

The Remote Login Flow

The remote login flow consists of the following steps:

  • Initiate the remote login process, which will return a URL and QR code the player can use to log in

  • The player visits the URL and logs in using their preffered identity provider

  • Game client polls the server to check if the player has logged in yet

  • Once the player has logged in, the poll will return a success response with a LootLocker session and a refresh token

  • The next time the player opens the game, the refresh token can be used to start a new session without the player having to go through the full flow again

Starting a Remote Session

As this function requires three separate callbacks, it is easier to manage them as following:

public void RemoteLease()
{
    LootLockerSDKManager.StartRemoteSession(leaseAction, pollingAction, onComplete);
}

Action<LootLockerLeaseRemoteSessionResponse> leaseAction = (info) =>
{
    if (!info.success)
    {
        Debug.Log("Couldnt start Remote leasing");
        return;
    }
};
Action<LootLockerRemoteSessionStatusPollingResponse> pollingAction = (polling) =>
{
    if(!polling.success)
    {
        Debug.Log("Couldnt poll Remote leasing");
        return;
    }
};
Action<LootLockerStartRemoteSessionResponse> onComplete = (onComplete) =>
{
    if (!onComplete.success)
    {
        Debug.Log("Couldnt start Remote leasing");
        return;
    }
};

First we call the endpoint to start the process

curl -X POST "https://api.lootlocker.io/game/session/remote/lease" \
  -H "LL-Version: 2021-03-01" \
  -H "Content-Type: application/json" \
  -d "{\"game_key\": \"your_game_key\", \"game_version\": \"1.0.0.0\" }"

To Poll for updates we can use the same endpoint, but include lease_code and nonce in the body

curl -X POST "https://api.lootlocker.io/game/session/remote" \
  -H "LL-Version: 2021-03-01" \
  -H "Content-Type: application/json" \
  -d "{\"game_key\": \"your_game_key\", \"game_version\": \"1.0.0.0\", \"lease_code\": \"R9SJMK2R\", \"nonce\": \"01HE2TM1JWRTPCWQFBYJ538XCE\" }"

Cancel the remote login process

If we for some reason want to cancel the process mid way, this is how we can do it.

LootLockerSDKManager.StartRemoteSession returns a Guid which we can later use to cancel the remote session start process.

public void RemoteLease()
{
    var leasedGuid =  LootLockerSDKManager.StartRemoteSession(leaseAction, pollingAction, onComplete);
    LootLockerSDKManager.CancelRemoteSessionProcess(leasedGuid);
}

Use the Refresh Token to Start a Session

In the response while creating our remote session we get a refresh token back. This token can be used to start a new session without the player having to go through the full flow again.

LootLockerSDKManager.RefreshRemoteSession((onComplete) =>
{
    if(!onComplete.success)
    {
        Debug.Log("Couldnt refresh remote session!");
        return;
    }
});

With manually stored refresh token:

string refreshToken = "";
LootLockerSDKManager.RefreshRemoteSession(refreshToken, (onComplete) =>
{
    if(!onComplete.success)
    {
        Debug.Log("Couldnt refresh remote session!");
        return;
    }
});
curl -X POST "https://api.lootlocker.io/game/session/remote" \
  -H "LL-Version: 2021-03-01" \
  -H "Content-Type: application/json" \
  -d "{\"game_key\": \"your_game_key\", \"game_version\": \"1.0.0.0\", \"refresh_token\": \"v4.public.eyJ.....\" }"

Conclusion

In this how-to we've shown how to start and manage remote sessions from your game. If you want to learn more about UPA you can read about or the general page.

🎭
A game created in the LootLocker web console
Game is configured to use UPA
Connected Accounts
Unified Player Account
Blueprint for Starting a Remote Session
Blueprint on Cancelling a Remote Session Process
Blueprint on Refreshing a Remote Session