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
| Parameters | Type | Description | Note |
|---|---|---|---|
| third_type | string | Third-party channel type: apple discord epic fbInstantGame garena kakaov3 line ps5 steam twitch vk xbox | Required |
| extra | Object | Configuration needed for specific third-party channel login For detailed configuration, refer to extra | Optional |
extra
| Parameters | Type | Explanation | Remark |
|---|---|---|---|
| appleAppId | string | Apple channel Web app ID | Required for Apple channel |
| platform | number | Specify Garena login method 1: Garena 3: Facebook 8: Google 10: Apple 11: Twitter | Optional for Garena channel |
| grnPromptLogin | number | Does the user need to log in to the Garena account every time 0: No, 1: Yes Default: 0 | Optional for Garena channel |
| kakaov3AppId | number | Kakao app ID | Required for Kakao v3 channel |
| kakaov3JsKey | string | Kakao Javascript Key | Required for Kakao v3 channel |
| wechatAuthType | number | 0: WeChat QR code login, 1: WeChat webpage authorization Default: 0 | Required for WeChat webpage authorization |
| wechatAppId | string | WeChat AppId | Required for WeChat webpage authorization |
| wechatScopeType | number | WeChat authorization scope type, 0: snsapi_login, 1: snsapi_userinfo, 2: snsapi_base | Optional 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
| Parameters | Type | Description |
|---|---|---|
| ret | number | Return code 0: request successful !=0: request failed, see msg for result details |
| msg | string | Result Description |
| access_token | string | Channel access token Different third-party channels return different tokens. For details, see Channel Information. |
Return Sample
{
msg: "Success",
ret: 0,
access_token: "xxxxx",
}