码迷,mamicode.com
首页 > 微信 > 详细

微信 登录 Scope 参数错误或没有 Scope 权限

时间:2017-07-04 13:16:22      阅读:2970      评论:0      收藏:0      [点我收藏+]

标签:tps   access   授权登录   login   ons   ken   wechat   rect   uri   

//电脑端 扫码授权登录

public static string AuthUrl = "https://open.weixin.qq.com/connect/qrconnect?appid={0}&redirect_uri={1}&response_type=code&scope=snsapi_login&state={2}#wechat_redirect";

 

//移动端 直接授权登录

public static string AuthUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri={1}&response_type=code&scope=snsapi_login&state={2}#wechat_redirect";

 

//获取 Token
public static string TokenRequestUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?grant_type=authorization_code&appid={0}&secret={1}&code={2}";

 

//获取 用户信息
public static string GetUserInfoUrl = "https://api.weixin.qq.com/sns/userinfo?access_token={0}&openid={1}";

 

微信公众号(公众平台) 和 微信开放平台 是两码事。

公众号(公众平台)获取的scope只包括两种:snsapi_base 和snsapi_userinfo,前者是静默获取,用户无感知;后者是需要用户确认同意的。

微信开放平台(https://open.weixin.qq.com/)  用 scope=snsapi_login

 

微信 登录 Scope 参数错误或没有 Scope 权限

标签:tps   access   授权登录   login   ons   ken   wechat   rect   uri   

原文地址:http://www.cnblogs.com/zengxiangzhan/p/7115994.html

(1)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!