Third-Party Channel Login
caution
LI PASS Web login for third-party channels is only supported for the system browser, and is not supported for the built-in WebView component of any game or app:
- Based on security concerns, Google and Facebook has prohibited the use of built-in WebView for web login.
- The WebView component cannot load two pages at the same time, and therefore the third-party login page cannot be loaded to complete the login process.
To support third-party channel login, set up third-party channels in the Player Network Console. Take Facebook as an example Configuration Guide - Facebook.
LI PASS Web widget supports using third-party channels to log in.
The LI PASS Web widget currently supports Apple, Discord, Epic, Facebook, Google, LINE, PS5, Steam, Twitch, Twitter, VK.
<div id="infinite-pass-component"></div>
const pass = new PassFactory.Pass({
env: "test", // Environment
gameID: "", // Game ID
appID: "", // Account App ID
config: {
socialList: ['facebook', 'twitter']
}
});
// Call `Start` to mount the widget to the specified DOM node
// After successful login, the login result is in intlSignResp
pass.start("#infinite-pass-component").then((userInfo) => {
console.log("userInfo: ", userInfo);
});
Key Configuration Parameters
Parameter | Type | Description | Remarks |
---|---|---|---|
socialList | string[] | Third-party channels: apple discord epic line ps5 steam twitch vk | Optional |
Return Parameter
Parameter | Type | Description |
---|---|---|
ret | number | Return code 0: Request success !=0: Request failure, see msg for detailed return message |
msg | string | Result description |
token | string | Player Network SDK generated user authorization token length 40 bytes, see Token |
openid | string | Player Network SDK unique user ID Default is a string of 64-bit unsigned integers, 32-bit is also supported |
token_expire_time | int64 | Token expiration time Unix time |
user_name | string | Username used for login |
birthday | string | User's birthday |
channel_info | object | Channel information for the current channel. For more information, see Channel Information. |
del_account_status | number | Delete account -1: Query failure 0: No record of cancellation of Player Network account deletion request (including email account and phone account) 1: Cooling-off period for deletion 2: Account deletion completed 3: Account deleted 4: Account deletion failed |
seq | string | Data stream message sequence number |
Return Sample
{
birthday: "",
channel_info: {
access_token:"xxxxx",
expire_ts: 1641527900,
}
first_login: 0,
gender: 0,
msg: "success",
need_name_auth: false,
openid: "xxxx",
pf: "facebook_fb-00000000-web-00000000-fb-xxxxxxxxxxxxxxxx-419213088809929925",
pf_key: "6cc9bxxxxxxxxxxxxxxxxxx826",
picture_url: "https://www.google.com/Images/profileA.png",
ret: 0,
seq: "1638935899-1006943754-018668-0000656615",
token: "xxx",
token_expire_time: 1641527900,
del_account_status: 0,
uid: "xxxx",
user_name: "user",
}