Skip to main content

Web

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

Prerequisites

1. Set up the LINE app on LINE Developers Console

1. Create a LINE app and configure a channel

Before configuring the app for required platforms, log in to LINE Developers Console and create a developer account. With the developer account, use LINE Developers Console and create a channel (communication path between LINE functions and your app).

Create a channel
  1. On the Console home, click Create New Provider and follow the on-screen instructions to create the provider.

    Image: Create a LINE Provider

  2. In the Channels tab on the provider page, click Create a LINE Login channel.

  3. On the new channel creation page, enter required information and click Create.

  4. In the Basic settings tab on the channel page, check the Channel ID and other required information for Player Network SDK configuration.

    Image: Add LINE app information

  5. Configure the channel for the Web app.
    In the LINE Login tab on the channel page, enable Web app and enter the callback URL based on the environment.

    Image: LINE Windows

  6. Click Update to save the configuration.

2. Add user permissions

Immediately after creating a channel, the channel is set to Developing mode. Only channel admin and testers have access to LINE login functions.

Add a tester
  1. Log in to LINE Developers Console.

  2. Select the corresponding channel from the most recently visited channels on the homepage.

    Image: Select LINE channel

  3. On the channel page, click Roles.

  4. In the Roles tab, click Invite by email.

    Image: LINE permission configuration

  5. Add testers in the Invite new members section.
    Email: LINE account of the tester
    Role: Tester

    Image: Add LINE tester

  6. Click Send Invitations to send tester invitations.

  7. Wait for the testers to accept the email invitation.

  1. Create an account for Player Network Console.
  2. Create a new project for your game, or join an existing one.
  3. Add LINE 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

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 LINE.

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

With the LINE 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: 'line',
channel_info: {
access_token: "EAAI2lTrXAZBwBAC",
expires_in: "xxxx",
}
}).then(
(res) => {
console.log(res);
});

Call the intlLogout method to log out from your website.

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