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.
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
- Register on Xbox Game Dev, then set up the Xbox game by following the steps in the official Microsoft Learn documentation.
- Create an account for Player Network Console.
- Create a new project for your game, or join an existing one.
- 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:
- Go to the engine source code:
Engine\Platforms\XSX\Source\Programs\UnrealBuildTool\UEBuildXSX.cs
. - Add the following two system libraries to the
SetUpEnvironment()
method.LinkEnvironment.SystemLibraries.Add("advapi32.lib");
LinkEnvironment.SystemLibraries.Add("oldnames.lib"); - Recompile
UnrealBuildTools
.
Step 1: Add Xbox Series X|S login
There is no need to configure any Xbox Series X|S account information, such as XBOX_APPID
in the INTLConfig.ini
file.
Add an observer to handle authentication callbacks.
- Unity
- Unreal Engine
// 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";
}
}C++ Event Handling (above v1.15)
//configure callback
FINTLAuthEvent authEvent;
authEvent.AddUObject(this, &OnAuthResult_Implementation);
UINTLSDKAPI::SetAuthResultObserver(authEvent);
// Remove callbacks
UINTLSDKAPI::GetAuthResultObserver().Clear();void OnAuthResult_Implementation(FINTLAuthResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}Unreal Event Handling
void OnAuthResult_Implementation(FINTLAuthResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}Call the
AutoLogin
method.- Unity
- Unreal Engine
INTLAPI.AutoLogin();
UINTLSDKAPI::AutoLogin();
Call the
Login
method to ask for user input if auto-login fails.- Unity
- Unreal Engine
INTLAPI.Login(INTLChannel.Xbox);
UINTLSDKAPI::Login(EINTLLoginChannel::kChannelXbox);
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.