绑定社会化登录
绑定社会化账号
(async function() { const authing = new Authing({ userPoolId: 'your_userpool_id', secret: 'your_userpool_secret' }); const bindResult = await authing.bindOAuth({ type: 'github', unionid: '12345678', userInfo: "{"login":"demo","id":12345678,"node_id":"demodemodemo","avatar_url":"https://avatars1.githubusercontent.com/u/19266401?v=4","gravatar_id":"","url":"https://api.github.com/users/demo","html_url":"https://github.com/demo","followers_url":"https://api.github.com/users/demo/followers","following_url":"https://api.github.com/users/demo/following{/other_user}","gists_url":"https://api.github.com/users/demo/gists{/gist_id}","starred_url":"https://api.github.com/users/demo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demo/subscriptions","organizations_url":"https://api.github.com/users/demo/orgs","repos_url":"https://api.github.com/users/demo/repos","events_url":"https://api.github.com/users/demo/events{/privacy}","received_events_url":"https://api.github.com/users/demo/received_events","type":"User","site_admin":false,"name":"demo","company":null,"blog":"","location":null,"email":"demo@gmail.com","hireable":null,"bio":"A web developer.","public_repos":10,"public_gists":0,"followers":2,"following":3,"created_at":"2016-05-09T12:43:11Z","updated_at":"2018-07-23T04:42:08Z"}" }); })();
{ "_id": "aeolkjhdhfhkkjdsfj", "user": "dfdfdsfdsfdsfdsfds", "client": "dsfjdskfjkldsjfklj", "type": "github", "userInfo": "{"login":"demo","id":12345678,"node_id":"demodemodemo","avatar_url":"https://avatars1.githubusercontent.com/u/19266401?v=4","gravatar_id":"","url":"https://api.github.com/users/demo","html_url":"https://github.com/demo","followers_url":"https://api.github.com/users/demo/followers","following_url":"https://api.github.com/users/demo/following{/other_user}","gists_url":"https://api.github.com/users/demo/gists{/gist_id}","starred_url":"https://api.github.com/users/demo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demo/subscriptions","organizations_url":"https://api.github.com/users/demo/orgs","repos_url":"https://api.github.com/users/demo/repos","events_url":"https://api.github.com/users/demo/events{/privacy}","received_events_url":"https://api.github.com/users/demo/received_events","type":"User","site_admin":false,"name":"demo","company":null,"blog":"","location":null,"email":"demo@gmail.com","hireable":null,"bio":"A web developer.","public_repos":10,"public_gists":0,"followers":2,"following":3,"created_at":"2016-05-09T12:43:11Z","updated_at":"2018-07-23T04:42:08Z"}", "unionid": "12345678", "createdAt": "2016-05-09T12:43:11Z" }
获取用户已经绑定的社会化账号
解绑社会化登录账号
Last updated
Was this helpful?