Configure native session sync
Overview
AccelByte Gaming Services (AGS) Session allows you to configure sessions to sync with first-party platforms such as Steam, Xbox, and PlayStation. This article covers how to do that.
Prerequisites
- Access to the AGS Admin Portal
- A game namespace
- A familiarity with configuring AGS sessions
- To follow the AGS CLI steps, you must have installed the AGS CLI and signed in with an account that has access to these features. See Install and sign in. The examples use a Bash shell.
Configure session sync for Steam
- Admin Portal
- AGS CLI
- Log in to the AGS Admin portal and choose your game namespace.
- On the sidebar menu, go to Foundations > 3rd Party Integrations > Auth & Account Linking.
- On the Auth & Account Linking page, click on the + Add New button. The Login Platform Configuration page appears.
- From the available login platforms, click on Steam Web. The Create Configuration form appears.
- Fill in the Steam Web API key.
- Fill in the Redirect URI.
- Click Create.
-
Create a JSON file with the Steam Web settings. Any file name works. This example uses
steamopenid.json:{
"Secret": "<YourSteamWebApiKey>",
"RedirectUri": "<YourRedirectUri>",
"IsActive": true
}Secret: your Steam Web API key.RedirectUri: the redirect URI, the same value you would type in Redirect URI in the Admin Portal.
-
Add Steam Web as a login method. Replace
<YourGameNamespace>with your game namespace. After@, pass the path to your JSON file:ags iam platform-credentials create --namespace <YourGameNamespace> --platform-id steamopenid --json @steamopenid.jsonThe file contains your Web API key, so delete it after the command runs.
Configure session sync for Xbox
- Admin Portal
- AGS CLI
- Log in to the AGS Admin portal and choose your game namespace.
- On the sidebar menu, go to Foundations > 3rd Party Integrations > Auth & Account Linking.
- On the Auth & Account Linking page, click on the + Add New button. The Login Platform Configuration page appears.
- From the available login platforms, click on XBox Web. The Create Configuration form appears.
- Fill in the Client ID and Client Secret (obtained from your app on your Xbox developer dashboard).
- Fill in the Redirect URI.
- Click Create.
- In the AGS Admin Portal, go to 3rd Party Store Integrations.
- Select the Xbox tab and click Add configuration.
- Upload the business partner certificate (BPC) and then click Create.
- Create a new Xbox session template via
https://partner.microsoft.com/en-US/xboxconfig/sessiontemplates/index?. - Create a new session template in the Admin Portal and enable session sync.
- Fill in the Xbox Template Name and Config ID at the end of the session template creation process.
-
Create a JSON file with the Xbox Web settings. Any file name works. This example uses
xblweb.json:{
"ClientId": "<YourXboxClientId>",
"Secret": "<YourXboxClientSecret>",
"RedirectUri": "<YourRedirectUri>",
"IsActive": true
}ClientIdandSecret: the client ID and client secret of your app on your Xbox developer dashboard.RedirectUri: the redirect URI, the same value you would type in Redirect URI in the Admin Portal.
-
Add Xbox Web as a login method. Replace
<YourGameNamespace>with your game namespace. After@, pass the path to your JSON file:ags iam platform-credentials create --namespace <YourGameNamespace> --platform-id xblweb --json @xblweb.jsonThe file contains your client secret, so delete it after the command runs.
-
Upload the business partner certificate (BPC) and enter its password in the Admin Portal, as in steps 8 to 10 of the Admin Portal tab. The AGS CLI accepts the certificate's password only as a command-line flag, which would leave the password in your shell history.
-
Sync the certificate to the Session service:
ags session platform-credentials sync --namespace <YourGameNamespace> --platform-id XBOX -
Create a new Xbox session template via
https://partner.microsoft.com/en-US/xboxconfig/sessiontemplates/index?. -
Create a new session template with session sync enabled. Follow the AGS CLI steps in Create, configure, and edit session templates, and add the following to the template's JSON file:
"NativeSessionSetting": {
"ShouldSync": true,
"XboxSessionTemplateName": "<YourXboxTemplateName>",
"XboxServiceConfigID": "<YourXboxConfigId>"
}XboxSessionTemplateName: the name of the Xbox session template from step 5.XboxServiceConfigID: your Xbox service configuration ID.
You can adjust readyRemovalTimeout (how long until "ready" members are reverted to inactive) and sessionEmptyTimeout (how long until a session is deleted after it becomes empty) as desired. See the Microsoft documentation for multiplayer sessions for more information.
Configure session sync for PlayStation
- Admin Portal
- AGS CLI
- Log in to the AGS Admin portal and choose your game namespace.
- On the sidebar menu, go to Foundations > 3rd Party Integrations > Auth & Account Linking.
- On the Auth & Account Linking page, click on the + Add New button. The Login Platform Configuration page appears.
- From the available login platforms, click on PSN 5 SDK. The Create Configuration form appears.
- Fill the Client ID and Client Secret from the PSN product page, and select the environment that you want to use.
- Fill in the Redirect URI.
- Click Create.
- Go to the 3rd Party Store Integrations page. On the Admin Portal sidebar, go to Foundations > 3rd Party Integraitons > Multiplayer Session.
- On the Multiplayer Session page, click on the Create new button and fill in the Client ID, Client Secret, and Scope as follows:
- ClientID: Auth Server (Client Credential) ClientID
- Client Secret: Auth Server (Client Credential) Secret
- Scope:
psn:s2s.service(For syncing non-PSN members to PSN sessions)
- Create a new session template and enable session sync.
- Fill in the Session title, Language and Session Title (You will need to add at least 1 localization for Language and Session title configuration), PSN Base URL, Supported Platform, Disable System UI Menu, and Service Label.
- Click Add.
-
Create a JSON file with the PSN 5 SDK settings. Any file name works. This example uses
ps5.json:{
"ClientId": "<YourPsnClientId>",
"Secret": "<YourPsnClientSecret>",
"Environment": "<YourPsnEnvironment>",
"RedirectUri": "<YourRedirectUri>",
"IsActive": true
}ClientIdandSecret: the client ID and client secret from the PSN product page.Environment: the environment that you want to use. Use one ofDEV,CERT,np,sp-int, orprod-qa. Each value is the first word of an environment option in the Admin Portal.RedirectUri: the redirect URI, the same value you would type in Redirect URI in the Admin Portal.
-
Add PSN 5 SDK as a login method. Replace
<YourGameNamespace>with your game namespace. After@, pass the path to your JSON file:ags iam platform-credentials create --namespace <YourGameNamespace> --platform-id ps5 --json @ps5.jsonThe file contains your client secret, so delete it after the command runs.
-
Create a JSON file with the multiplayer session credentials. This example uses
psn-session.json:{
"psn": {
"clientId": "<YourAuthServerClientId>",
"clientSecret": "<YourAuthServerClientSecret>",
"scope": "psn:s2s.service"
}
}clientIdandclientSecret: the client ID and secret of your Auth Server (Client Credential).scope:psn:s2s.service, for syncing non-PSN members to PSN sessions.
-
Save the credentials:
ags session platform-credentials update --namespace <YourGameNamespace> --json @psn-session.jsonThe file contains your client secret, so delete it after the command runs.
-
Create a new session template with session sync enabled. Follow the AGS CLI steps in Create, configure, and edit session templates, and add the following to the template's JSON file:
"PSNBaseUrl": "<YourPsnBaseUrl>",
"PSNEnvironment": "<YourPsnEnvironment>",
"NativeSessionSetting": {
"ShouldSync": true,
"SessionTitle": "<YourSessionTitle>",
"localizedSessionName": {
"defaultLanguage": "en-US",
"localizedText": {
"en-US": "<YourSessionTitle>"
}
},
"PSNSupportedPlatforms": ["ps5"],
"PSNDisableSystemUIMenu": [],
"PSNServiceLabel": 0
}Admin Portal field Request body field Session title NativeSessionSetting.SessionTitleLanguage and Session Title NativeSessionSetting.localizedSessionName. Add at least one language tolocalizedText, and setdefaultLanguageto one of them.PSN Base URL PSNBaseUrlandPSNEnvironment, from the table belowSupported Platform NativeSessionSetting.PSNSupportedPlatforms: any ofps5,ps4, andpspcDisable System UI Menu NativeSessionSetting.PSNDisableSystemUIMenu: any ofKICK,PROMOTE_TO_LEADER,UPDATE_JOINABLE_USER_TYPE, andUPDATE_INVITABLE_USER_TYPEService Label NativeSessionSetting.PSNServiceLabelPSN Base URL option PSNBaseUrlPSNEnvironmentDEV https://s2s.np.playstation.netDEVCERT https://s2s.np.playstation.netCERTnp https://s2s.np.playstation.net""sp-int https://s2s.sp-int.playstation.net""prod-qa https://s2s.prod-qa.playstation.net""