Skip to main content

ThirdAuthorize

The ThirdAuthorize API is used to get the login authorization information of the third-party login channel. It is often used for Player Network account login operation. Different third-party channel returns different tokens, see Channel Information for more information.

Request Parameter

ParameterTypeDescriptionRemark
third_typestringThird-party channels:
apple
discord
epic
facebook
fbInstantGame
garena
google
kakaov3
line
ps5
steam
twitch
twitter
vk
xbox
qq
wechat
Required
extraobjectConfiguration required when logging in through some third-party channels
See extra for detailed configurations
Optional

extra

ParameterTypeDescriptionRemark
appleAppIdstringWeb app ID for AppleRequired for apple
platformnumberSpecifies the login method for Garena
1: Garena
3: Facebook
8: Google
10: Apple
11: Twitter
Optional for Garena
kakaov3AppIdnumberKakao app IDRequired for Kakao v3
kakaov3JsKeystringKakao Javascript keyRequired for Kakao v3
wechatAuthTypenumber0: WeChat QR code login, 1: WeChat web authorization
Default: 0
Required for WeChat web authorization
wechatAppIdstringWeChat AppIdRequired for WeChat web authorization
wechatScopeTypenumberWeChat scope type, 0: snsapi_login, 1: snsapi_userinfo, 2: snsapi_baseOptional for WeChat web authorization

Request Sample

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);
});

Response Parameter

ParameterTypeDescription
retnumberReturn code
0: Request success, parse related returned field information.
!=0: Request failure, check msg for the detailed return message.
msgstringReturn message
access_tokenstringAccess token for the third-party channel
Different third-party channel returns different tokens, see Channel Information for more information.

Response Sample

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