新浪微博oauth2.0
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了新浪微博oauth2.0相关的知识,希望对你有一定的参考价值。
1.请求用户授权:
http://open.weibo.com/wiki/Oauth2/authorize
https://api.weibo.com/oauth2/authorize?client_id=1317723116&redirect_uri=http%3a%2f%2flocalhost%3a1411%2fredirecturi.aspx&response_type=code&display=Default
2.通过code换取token(令牌)信息
http://open.weibo.com/wiki/Oauth2/access_token
responseData{"access_token":"2.00CJ4g5GeyBL8B8d5bce0712eyhtSD","remind_in":"157679999","expires_in":157679999,"uid":"5861527804"}
{"id":5861527804,"idstr":"5861527804","class":1,"screen_name":"PengsWan","name":"PengsWan","province":"32","city":"1","location":"江苏 南京","description":"","url":"","profile_image_url":"http://tva4.sinaimg.cn/crop.0.0.170.170.50/006oGn92jw8f12fcu13mqj304q04qt8h.jpg","profile_url":"u/5861527804","domain":"","weihao":"","gender":"m","followers_count":3,"friends_count":1,"pagefriends_count":0,"statuses_count":0,"favourites_count":0,"created_at":"Wed Feb 17 16:40:00 +0800 2016","following":false,"allow_all_act_msg":false,"geo_enabled":true,"verified":false,"verified_type":-1,"remark":"","ptype":0,"allow_all_comment":true,"avatar_large":"http://tva4.sinaimg.cn/crop.0.0.170.170.180/006oGn92jw8f12fcu13mqj304q04qt8h.jpg","avatar_hd":"http://tva4.sinaimg.cn/crop.0.0.170.170.1024/006oGn92jw8f12fcu13mqj304q04qt8h.jpg","verified_reason":"","verified_trade":"","verified_reason_url":"","verified_source":"","verified_source_url":"","follow_me":false,"online_status":0,"bi_followers_count":0,"lang":"zh-cn","star":0,"mbtype":0,"mbrank":0,"block_word":0,"block_app":0,"credit_score":80,"user_ability":0,"urank":4}
querystring: access_token=2.00CJ4g5GeyBL8B8d5bce0712eyhtSD
https://api.weibo.com/2/account/get_uid.json
https://api.weibo.com/2/account/get_uid.json?access_token=2.00CJ4g5GeyBL8B8d5bce0712eyhtSD
以上是关于新浪微博oauth2.0的主要内容,如果未能解决你的问题,请参考以下文章
OAuth2.0学习(5-1)新浪开放平台-微博OAuth2.0认证
OAuth2.0学习(5-4)新浪开放平台-微博API-使用OAuth2.0调用API