Skip to main content

Web

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

note

PS5 developer access is not open to individual developers. Only legal entity such as a corporation or a company can request for developer access from Sony.

Prerequisites

1. Set up the PS5 game on PlayStation5 DevNet and request for the 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

  1. Create an account for Player Network Console.
  2. Create a new project for your game, or join an existing one.
  3. Add PS5 as an authentication method for your project on Player Network Console.
note

For more details about integrating the SDK for other third-party channels, see JavaScript SDK.

Step 1: Install the JavaScript SDK

caution

Install the SDK package from the production environment when launching the game. The SDK package from the test environment is only used for integration testing.

Install the JavaScript SDK from npm or CDN.

$ npm install @intlsdk/account-api

Step 2: Instantiate the SDK

caution

Set env to the test environment during the integration testing and env to the corresponding production environment when launching the game.

const accountApi = new IntlgameAccountApi({
env: "test", // SDK environment
gameID: 11,
});
ParameterTypeDescriptionRemark
envstringSDK environment
For more information, see Retrieve cluster information.
Required
gameIDnumberUnique game ID assigned by Player NetworkRequired

Step 3: Implement web login

After instantiating the accountApi component, call the thirdAuthorize method to request the access token from PlayStation.

accountApi.thirdAuthorize({
third_type: 'ps5',
}).then(
(res) => {
console.log(res);
});

With the PlayStation token returned, call the intlAuthorize method to get the Player Network SDK OpenID and token to log in to your website.

accountApi.intlAuthorize({
third_type: 'ps5',
channel_info: {
code: "EAAI2lTrXAZBwBAC",
redirect_uri: "EAAI2lTrXAZBwBAC"
}
}).then(
(res) => {
console.log(res);
});

Call the intlLogout method to log out from your website.

accountApi.intlLogout({
token: '4567xsdfsd',
openid: 'xxxxxxxx',
channel_id: 27,
}).then(
(res) => {
console.log(res);
});