netnr 2018-01-11 21:10:48 2020-06-08 08:01:26 👁871 💬0

项目地址:https://github.com/netnr/Netnr.Login https://github.com/netnr/np

微博接入地址:http://open.weibo.com/development

接入微博登录需要做哪些事情:

  • 备案域名,公网环境,成熟站点
  • 创建应用,填写网站地址,并得到App KeyApp Secret

步骤

  1. authorize 接口:https://api.weibo.com/oauth2/authorize
    获取用户授权,即页面跳转微博登录界面,GET请求,得到code

  2. access_token 接口:https://api.weibo.com/oauth2/access_token
    根据code得到access_token,用户授权的唯一票据, POST请求

  3. get_token_info 接口:https://api.weibo.com/oauth2/get_token_info
    根据access_token得到授权信息uidPOST请求

  4. users/show 接口:https://api.weibo.com/2/users/show.json
    根据access_tokenuid获取用户信息,GET请求

使用

Install-Package Netnr.Login

参考项目地址给出的示例代码


链接