Skip to main content

PS5

This article guides you through setting up PlayStation as an identity provider, enabling your PS5 game to access Player Network authentication services.

note

PS5 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 Sony.

Prerequisites

1. Set up the PS5 game on PlayStation5 DevNet
Request for Client ID and Client Secret

After obtaining developer access, register the game app on PlayStation5 DevNet.

  1. On the top navigation bar of PlayStation5 DevNet, click Titles > Titles and products to open the Titles and Products page.

  2. On the top left corner of the page, click New product.

    Image: PS5 Register Product

  3. On the Add a new product popup, enter basic product information.

    info

    Choose App Server for Product Type.

    Image: PS5 Add Product

  4. Click Add Product to add a new product.
    Add a New Service page is displayed if the product is added successfully.

  5. As Player Network SDK uses refresh token to refresh PS5 token, on the Client ID service configuration section, select use refresh token.

    Image: PS5 Refresh Token

  6. Click Confirm Client ID configuration.
    The Client ID service configuration page is refreshed to confirm the Client ID information.

  7. Click Request Client ID to complete the new product registering process.
    Sony takes time to create the product. After the backend process is completed, the product page for the registered product is displayed.

    Image: PS5 Request Client ID

  8. Click Download Client Secret to download the Client Secret for your product. Configure the Client ID and Client Key for Player Network backend setting.

    Image: PS5 Download Client Secret

[Optional] Activate DUIDs

DUIDs (Device Unique IDs) are unique IDs that identify the PS5 device and is independent of the logged in user. To start using DUID, apply for permissions by manually submitting a support request:
https://game.develop.playstation.net/support/newissue/gdtg-tokyo

Starting from Player Network SDK V1.22, Player Network supports obtaining DUIDs. If DUID has been activated, use the GetDeviceInfo API to obtain DUIDs.

  1. Create an account for Player Network Console.
  2. Create a new project for your game, or join an existing one.
  3. Download the SDK.
  4. Integrate the SDK.
  5. Add PS5 as an authentication method for your project on Player Network Console.

Step 1: Configure the SDK for PlayStation login

Configure the PS5_CLIENT_ID field in the INTLConfig.ini file with the Client ID obtained from PlayStation5 DevNet.

Player Network SDK obtains DUIDs by default. If DUID is not needed, disable the function by modifying the INTL_PS5_DUID_ENABLE field. For more information, see Activate DUIDs.

[INTL PS5]
PS5_CLIENT_ID = {INTL_PS5_CLIENT_ID}
INTL_PS5_DUID_ENABLE = 0 //1: Enable DUID, 0: Disable DUID

Step 2: Add PS5 login

PS5 account service

PS5 system software allows multiple players to log into PS5 simultaneously. It also allows the simple creation of multiplayer games. PlayStation divides games into three types based on the number of users logged into the game: games with a single player logged in locally, games with multiple players logged in locally, and games played in turns with more players logged in locally than the number of gamepads.

For games with single player logged in locally, there is no need to manage a complicated PS account login process, and the initial user who started the game can be identified as the login user of the current game. If the player wants to switch the account to log into the game, they need to log out the current account and restart the game app.

Currently, Player Network SDK only supports single-player login.

The permission field

The PS5 login process calls the Login interface or the LoginWithMappedChannel interface of Player Network SDK. Games need to enter the scope to get player information in the permission field. scope indicates the range of player information that the game can get.

It is recommended to use psn:s2s openid id_token:psn.basic_claims for the scope.

PS5 configurations

For Player Network SDK to function properly, ensure that the following configurations are set in param.json:

  • As Player Network SDK currently only supports single-player login, ensure that InitialUserAlwaysLoggedIn is always enabled.

  • As data is downloaded and saved, set the downloadDataSize to at least 1 MB.

Retrieve PS5 user ID

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

"{\"code\":\"v3.g21b1B\",\"issuerId\":1,\"userId\":281231663,\"map_info\":{\"sacc_uid\":\"56908591234\",\"sacc_token\":\"3RY3JXA2nT9gJlsi5J8S7SKklLQ@1U_ILn1234563ejYPBzH1o81OYAJNXsgVSSZCkwYjl_m1nOF6ZwfUzHalw==\",\"sacc_account_plat_type\":25},\"access_token\":\"d6013ba2-679c-4f21-99ca-3b57123456b4\",\"uid\":\"4574198251123456590\",\"expire_ts\":1637329774,\"refresh_token\":\"7470a803-51a1-4120-ad29-e488c2111199\"}"
  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.PS5,"psn:s2s openid id_token:psn.basic_claims","{}");
  4. Sync client authentication state with the game's backend and wait for the final authentication result.

Step 3: 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.