项目地址:
https://github.com/netnr/Netnr.Loginhttps://github.com/netnr/np
接入微博登录需要做哪些事情:
- 备案域名,公网环境,成熟站点
- 创建应用,填写
网站地址,并得到App Key、App Secret
步骤
authorize 接口:https://api.weibo.com/oauth2/authorize
获取用户授权,即页面跳转微博登录界面,GET请求,得到codeaccess_token 接口:https://api.weibo.com/oauth2/access_token
根据code得到access_token,用户授权的唯一票据,POST请求get_token_info 接口:https://api.weibo.com/oauth2/get_token_info
根据access_token得到授权信息uid,POST请求users/show 接口:https://api.weibo.com/2/users/show.json
根据access_token、uid获取用户信息,GET请求
使用
Install-Package Netnr.Login参考项目地址给出的示例代码