Skip to content

Meta / Oculus

This how-to walks you through configuring Meta / Oculus sign-in and starting a session from your game.

Prerequisites

  • Unity, Unreal, or Godot SDK installed and configured in your project (not required for REST).
  • A Meta developer account with access to the Meta Dashboard.

Configuration

Configure your integration in the platform settings.

Meta platform settings in the Web Console

Meta App ID / App Secret: retrieve these from the Meta Dashboard, in the API section for your app.

Start Session

Fetch the User ID and Nonce using the Oculus SDK provided by Meta — see the Unity or Unreal documentation. Then pass the User ID and Nonce to LootLocker. The response includes a refresh token, which lets you refresh the session without repeating the full sign-in flow.

string userID = "user_id";
string nonce = "nonce";
LootLockerSDKManager.StartMetaSession(userID, nonce, (response) =>
{
if (!response.success)
{
Debug.Log("error starting LootLocker session");
return;
}
Debug.Log("session started successfully");
// Store these to be able to refresh the session without using the full sign in flow
string refreshToken = response.refresh_token;
});

Refresh Session

Refresh the session instead of having the player go through the full sign-in flow every time. The request returns a 401 (Unauthorized) if the refresh token has expired, in which case start a new session instead.

LootLockerSDKManager.RefreshMetaSession((response) =>
{
if (!response.success)
{
if (response.statusCode == 401) {
// Refresh token has expired, use StartMetaSession
}
else {
Debug.Log("error starting LootLocker session");
}
return;
}
Debug.Log("session started successfully");
});

Conclusion

You've started using LootLocker in your game with Meta / Oculus authentication. Next, review LootLocker's full feature set to decide which other features to implement.