Skip to main content

Third-party Channel Authorization (thirdAuthorize)

The thirdAuthorize interface is used to obtain login authorization information from third-party login channels.It is usually used for Player Network account login operations.Different third-party channels return different tokens. For more information, see Channel Information.

Request parameters

ParametersTypeDescriptionNote
third_typestringThird-party channel type:
apple
discord
epic
facebook
fbInstantGame
garena
google
kakaov3
line
ps5
steam
twitch
twitter
vk
xbox
qq
wechat
Required
extraObjectConfiguration needed for specific third-party channel login
For detailed configuration, refer to extra
Optional

extra

ParametersTypeExplanationRemark
appleAppIdstringApple channel Web app IDRequired for Apple channel
platformnumberSpecify Garena login method
1: Garena
3: Facebook
8: Google
10: Apple
11: Twitter
Optional for Garena channel
grnPromptLoginnumberDoes the user need to log in to the Garena account every time
0: No, 1: Yes
Default: 0
Optional for Garena channel
kakaov3AppIdnumberKakao app IDRequired for Kakao v3 channel
kakaov3JsKeystringKakao Javascript KeyRequired for Kakao v3 channel
wechatAuthTypenumber0: WeChat QR code login, 1: WeChat webpage authorization
Default: 0
Required for WeChat webpage authorization
wechatAppIdstringWeChat AppIdRequired for WeChat webpage authorization
wechatScopeTypenumberWeChat authorization scope type, 0: snsapi_login, 1: snsapi_userinfo, 2: snsapi_baseOptional for WeChat webpage authorization

Request example

accountApi.thirdAuthorize({
third_type: 'kakaov3',
extra: {
kakaov3AppId: 111, // Required for kakao v3 login
kakaov3JsKey: 'xxx', // Required for kakao v3 login
}
}).then(
(res) => {
console.log(res);
});
accountApi.thirdAuthorize({
third_type: 'apple',
extra: {
appleAppId: 'xxxxx', // Required for apple login
}
}).then(
(res) => {
console.log(res);
});
accountApi.thirdAuthorize({
third_type: 'garena',
extra: {
grnPromptLogin: 1, // user needs to log in every time
}
}).then(
(res) => {
console.log(res);
});

Return Parameters

ParametersTypeDescription
retnumberReturn code
0: request successful
!=0: request failed, see msg for result details
msgstringResult Description
access_tokenstringChannel access token
Different third-party channels return different tokens. For details, see Channel Information.

Return Sample

{
msg: "Success",
ret: 0,
access_token: "xxxxx",
}