This page focuses on the XBOX-side of the integration — how to provision a PlayFab account tied to the signed-in XUser, and how the Microsoft Store entitlement flow plumbs into PlayFab economy. For the full PlayFab feature surface (Game Manager, catalogs, cloud script, matchmaking, Party), see the PlayFab documentation.
XBOX and PlayFab user accounts
An XBOX services account and a PlayFab account are two separate identities:- XBOX services account — player-facing. Owned by the player’s Microsoft Account (MSA). Carries gamertag, XUID, friends, achievements, presence.
- PlayFab account — behind-the-scenes. Identified by an Entity ID inside your PlayFab TitleId (a 4–6 hex-digit string assigned when you create a title in PlayFab Game Manager). Not the same as your XBOX title ID.
- The player has been added with
XUserAddAsyncand holds anXUserHandle. - A PlayFab account exists for that player under your PlayFab TitleId (auto-provisioned on first sign-in).
- The XBOX and PlayFab accounts are linked, and the title holds valid credentials (Entity ID + PlayFab token) for authenticated PlayFab REST/SDK calls.
Sign players in to PlayFab
There are two supported sign-in paths. Pick one based on which PlayFab services you use:PlayFab Services SDK
Recommended for all titles. Ships as a Gaming Extension Library (
PlayFab.Services.C) in the GDK. Use for economy, leaderboards, cloud script, matchmaking, and any title that uses more than just Party.PlayFab Party Xbox Live Helper Library
Use only if PlayFab Party is the sole PlayFab service you use and XBOX services is your only auth provider. Ships with the PlayFab Party SDK inside the GDK.
PlayFab Services SDK (recommended)
The PlayFab Services SDK ships with the GDK and exposesPFAuthenticationLoginWithXUserAsync, which takes an XUserHandle and signs the player into PlayFab in one call. Set createAccount = TRUE to auto-provision the linked PlayFab account on first run.
Set up
- Install the GDK.
- Add the PlayFab.Services.C Gaming Extension Library to your project:
- Open the project in Visual Studio → Project → Properties.
- Under Configuration Properties → Gaming Desktop → General, open Gaming Extension Libraries and add PlayFab.Services.C.
- Sign the player into their XBOX account with
XUserAddAsyncand hold onto the returnedXUserHandle. - Call
PFAuthenticationLoginWithXUserAsync:- Pass the
XUserHandleas theuserparameter. - Set
createAccount = TRUEso PlayFab auto-provisions a linked account on first sign-in.
- Pass the
- Persist the resulting PlayFab credentials (Entity ID + PlayFab token) for the session and use them for all subsequent PlayFab calls.
PlayFab Party XBOX Live Helper Library
If PlayFab Party is the only PlayFab service your title uses, you can skip the PlayFab Services SDK and sign in via the Party XBOX Live Helper Library, which is bundled with the PlayFab Party SDK in the GDK. Flow- Sign the player into XBOX with
XUserAddAsync. - When chat is first initiated, retrieve the XUID with
XUserGetId. - Create a
PartyXblLocalChatUserby callingPartyXblManager::CreateLocalChatUserwith the XUID. - Call
PartyXblManager::LoginToPlayFabwith that user object.- On GDK (console and PC) and XDK, the helper library internally fetches the required XBOX services token, signs the player into PlayFab using their XBOX credentials, and auto-creates a PlayFab account on first sign-in. Accounts created this way have no email or username attached.
- On non-GDK/non-XDK titles (for example, PC Win32 without GDK) you receive a
PartyXblTokenAndSignatureRequestedStateChangeinstead. Fetch the XBOX services token yourself and pass it back viaPartyXblManager::CompleteGetTokenAndSignatureRequest.
- On success you receive a
PartyXblLoginToPlayFabCompletedStateChangecarrying the PlayFab Entity ID and token.
For remote users, use
PartyXblManager::CreateRemoteChatUser — no authentication or token exchange is required for the remote user flow.XUser is the identity bridge
Everything downstream — PlayFab sign-in, MPSD session write tokens, S2S calls, entitlement queries — begins with anXUserHandle returned from XUserAddAsync. Two APIs matter for PlayFab integration:
See XBOX services identity for the wider sign-in model (MSA, XSTS tokens, sandbox scoping).
Cross-platform titles
PlayFab supports many platform auth providers. When you ship the same title on iOS, Android, Steam, or PlayStation, do not try to route every player through XUser — use the platform’s native PlayFab auth provider:- iOS — Apple ID (
LoginWithApple). - Android — Google Play Games (
LoginWithGoogleAccount). - Steam —
LoginWithSteam. - XBOX / GDK PC —
PFAuthenticationLoginWithXUserAsync(this page).
Microsoft Store in-app purchase via PlayFab economy
For GDK titles that sell in-app items through the Microsoft Store, PlayFab acts as the economy backend while the Microsoft Store handles the actual transaction. PlayFab reconciles Microsoft Store purchases into the player’s PlayFab inventory using the entitlement method — the player must be signed into their XBOX account first.The flow
- Player is signed in to XBOX (
XUserAddAsync) and PlayFab (PFAuthenticationLoginWithXUserAsync). - Player buys an item through the Microsoft Store on-device.
- Your title notifies PlayFab of the purchase.
- PlayFab calls
ConsumeMicrosoftStoreEntitlementswith the XBOX token and syncs the player’s PlayFab inventory, granting any new items.
Partner Center prerequisites
- Enrolled in the XBOX Creators Program or a Managed Partner.
- Publisher identity configured in Partner Center with the same publisher GUID as your XBOX business partner information (
aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee). - Concept approval to use XBOX services.
PlayFab’s Microsoft Store add-on does not support store-managed consumables in Partner Center. Create developer-managed consumables (or durables) only.
Create matching items in Partner Center and PlayFab
The Product ID in Partner Center and the Item ID in PlayFab must match exactly for entitlement sync to work.- In Partner Center → Add-ons → Create a new Consumable (Developer-managed) (or Durable). Enter a unique Product ID (for example,
MyItem_001). - In PlayFab Game Manager → Engage → Economy → New item. Enter the same string in Item ID (
MyItem_001). Mark it Consumable or Durable to match Partner Center, and save.
Terminology reference
Catalogs and Stores — one Item ID globally
PlayFab lets you define multiple Catalogs per title, and within each Catalog you can group items into Stores. For Microsoft Store entitlement sync to work, each Product ID must match exactly one Item ID across all Catalog versions in your PlayFab title. Wrong — same ID reused across catalogs:
Right — one Item ID per SKU, reused across Stores freely:
Stores inside a Catalog can then bundle any subset of those unique items freely:
See also
- XBOX services identity — XUser, MSA, XSTS tokens, sandbox scoping.
- XBOX multiplayer — PlayFab Party as a multiplayer transport option.
- Game Chat 2 — Game Chat 2 layered on top of PlayFab Party.
- Multiplayer Activity — MPA + PlayFab Party integration.
- PlayFab Services SDK Quickstart for GDK
- PlayFab pricing
