首页 > 微信 > 详细

微信 oauth授权2

时间:2017-02-17 09:54:06      阅读:289      评论:0      收藏:0      [点我收藏+]

2.前面请求成功后 会在跳转url后得到

?code=00b788e3b42043c8459a57a8d8ab5d9f&state=1


3.之后

使用code换取access_token

换取网页授权access_token页面的构造方式:

https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code

参数说明

参数是否必须说明
appid 公众号的唯一标识
secret 公众号的appsecret
code 填写第一步获取的code参数
grant_type 填写为authorization_code

code:在这里填写为上一步获得的值

构造请求url如下:

https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx8888888888888888&secret=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&code=00b788e3b42043c8459a57a8d8ab5d9f&grant_type=authorization_code

微信 oauth授权2

原文:http://www.cnblogs.com/yelongsan/p/6408312.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!