Skip to main content

Web

This document introduces how to set up Steam authentication, allowing your web page to use Player Network's login authentication service to sign in via the Steam channel.

Prerequisites​

note

Steam Web API requests are limited to 100,000 times per day.For more information about Steam request limits, see Steam Web API Terms of Use.

  1. Apply for a developer account on the official Steam website, set up your game, and obtain your game's App ID.
  2. Go to the Player Network Console to create a new project for your game or join an existing one.
  3. Add Steam as a login authentication method in Player Network Console.

For more information about integrating other third-party channels into the SDK, see JavaScript SDK.

Step 1: Introduce JavaScript SDK​

Currently, both npm package method and CDN method are supported.

$ npm install @intlsdk/account-api

Step 2: Use SDK​

caution

During integration testing, set env to test environment; when the project goes live, set env to the corresponding official environment.

const accountApi = new IntlgameAccountApi({
env: "test", // SDK environment
gameID: 11,
});
ParametersTypeDescriptionNote
envstringSDK environment
For more information, see Obtain deployment cluster information.
Required
gameIDnumberPlayer Network unique game IDRequired

Step 3: Implement Web Login​

After instantiating the accountApi component, call the thirdAuthorize API to request the attributes required for Steam web login.For details about the required properties, see Steam Channel Information Description.

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

After Apple returns the access token, call the intlAuthorize API to obtain Player Network SDK OpenID and token to log in to the website.

accountApi.intlAuthorize({
third_type: 'steam',
channel_info: {
openid.ns: "EAAI2lTrXAZBwBAC",
openid.mode: "EAAI2lTrXAZBwBAC",
openid.op_endpoint: "EAAI2lTrXAZBwBAC",
openid.claimed_id: "EAAI2lTrXAZBwBAC",
openid.identity: "EAAI2lTrXAZBwBAC",
openid.return_to: "EAAI2lTrXAZBwBAC",
openid.response_nonce: "EAAI2lTrXAZBwBAC",
openid.assoc_handle: "EAAI2lTrXAZBwBAC",
openid.signed: "EAAI2lTrXAZBwBAC",
openid.sig: "EAAI2lTrXAZBwBAC",
}
}).then(
(res) => {
console.log(res);
});

Use the intlLogout API to log out of the website.

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