Skip to main content

XSX

This article guides you through setting up Xbox Series X|S as an identity provider, enabling your Xbox game to access Player Network authentication services.

note

Xbox Series X|S developer access is not open to individual developers. Users have to be a legal entity such as a corporation or a company to request for developer access from Microsoft.

Prerequisites

  1. Register on Xbox Game Dev, then set up the Xbox game by following the steps in the official Microsoft Learn documentation.
  2. Create an account for Player Network Console.
  3. Create a new project for your game, or join an existing one.
  4. Download the SDK.
5. Integrate the SDK

Follow the respective guides to Integrate the SDK into your game.

For Player Network SDK V1.23.00 - V1.24.00, also configure the following:

  1. Go to the engine source code: Engine\Platforms\XSX\Source\Programs\UnrealBuildTool\UEBuildXSX.cs.
  2. Add the following two system libraries to the SetUpEnvironment() method.
    LinkEnvironment.SystemLibraries.Add("advapi32.lib");
    LinkEnvironment.SystemLibraries.Add("oldnames.lib");
  3. Recompile UnrealBuildTools.
  1. Add Xbox Series X|S as an authentication method for your project on Player Network Console.

Step 1: Add Xbox Series X|S login

note

There is no need to configure any Xbox Series X|S account information, such as XBOX_APPID in the INTLConfig.ini file.

  1. Add an observer to handle authentication callbacks.

    // Add callbacks
    public void AddAuthObserver()
    {
    INTLAPI.AddAuthResultObserver(OnAuthResultEvent);
    }

    // Remove callbacks
    public void RemoveAuthObserver()
    {
    INTLAPI.RemoveAuthResultObserver(OnAuthResultEvent);
    }

    // Process the INTLAuthResult callback
    public void OnAuthResultEvent(INTLAuthResult ret)
    {
    Debug.Log($"MethodID: {ret.MethodId}");

    string methodTag = "";
    if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_LOGIN)
    {
    methodTag = "Login";
    }
    else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_BIND)
    {
    methodTag = "Bind";
    }
    else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_AUTOLOGIN)
    {
    methodTag = "AutoLogin";
    }
    else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_QUERY_USER_INFO)
    {
    methodTag = "QueryUserInfo";
    }
    else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_GET_AUTH_RESULT)
    {
    methodTag = "GetAuthResult";
    }
    }
  2. Call the AutoLogin method.

    INTLAPI.AutoLogin();
  3. Call the Login method to ask for user input if auto-login fails.

    INTLAPI.Login(INTLChannel.Xbox);
  4. Sync client authentication state with game backend and wait for final authentication result.

Retrieve Xbox user ID

After a successful login, the ChannelInfo field of INTLAuthResult for Unity and FINTLAuthResult for Unreal Engine will provide the userId.

"{\"code\":\"v3.xxxx\",\"issuerId\":1,\"userId\":281xxxxxx,\"map_info\":{\"sacc_uid\":\"569xxxxxxxx\",\"sacc_token\":\"3RYxxx==\",\"sacc_account_plat_type\":25},\"access_token\":\"d601xxxx-xxxx-xxxx-xxxx-3b57xxxxxxxx\",\"uid\":\"457xxxxxxxxxxxxxxxx\",\"expire_ts\":163xxxxxxx,\"refresh_token\":\"7470xxxx-xxxx-xxxx-xxxx-e488xxxxxxxx\"}"

Step 2: Test the login function

Search for the keyword "AuthResult" in the Player Network SDK logs to verify if the correct channel name and OpenID are returned. If they are, it indicates a successful configuration and the login function has been added successfully.