Home

PlayFab Auth

Learn how to interact with PlayFab Auth

PlayFab provides a comprehensive suite of live game management services, including server hosting, data analytics, and liveOps utilities to streamline game development and monetization. It is designed to empower developers with the tools needed to engage players and drive revenue, all while minimizing overhead and time to market.

Prerequisites#

To set up your PlayFab authentication with Openfort, you'll need to get the Project ID.

  1. Visit the PlayFab developer dashboard, select your title, and navigate to Settings wheel --> Title settings:
playfab title settings
  1. In the API Features section, copy your Title ID:
get playfab title id

Set up your provider#

To set up your PlayFab to authenticate players with Openfort, visit your dashboard provider settings.

playfab auth

Client-side Integration#

Where the identityToken is a client session ticket, available from any Client Login function.


_14
using System.Collections;
_14
using System.Collections.Generic;
_14
using UnityEngine;
_14
using Openfort;
_14
using Openfort.Model;
_14
public class openfortManager: MonoBehaviour {
_14
private OpenfortSDK Openfort;
_14
const string PublishableKey = "pk_test_54cebc96-493c-553c-9192-4417cc4d8a4b";
_14
_14
async void Start(string identityToken) {
_14
Openfort = new OpenfortSDK(PublishableKey);
_14
await Openfort.AuthenticateWithThirdPartyProvider(OAuthProvider.Playfab, identityToken, TokenType.IdToken);
_14
}
_14
}

Uppon successful authentication, the SDK will return:

response.json

_12
{
_12
"id": "pla_cc9ed2b7-c5f5-4c43-8dca-c4b104ba1762",
_12
"object": "player",
_12
"createdAt": 1710976453,
_12
"linkedAccounts": [
_12
{
_12
"provider": "oidc",
_12
"disabled": false,
_12
"externalUserId": "2"
_12
}
_12
]
_12
}

Example#

Resources#