justauth/JustAuth

bug:微信授权scope=snsapi_base时,报 api unauthorized

daixinbao opened this issue · 1 comments

微信授权scope=snsapi_base时 是无法获取用户信息的,只能拿到openid。
问题:但走微信公众号静默授权登录时 ,AuthWeChatMpRequest 拿到openid 后,去调用了获取用户信息接口,此时微信会返回 api unauthorized。
建议:AuthWeChatMpRequest #getUserInfo 方法 根据 scope来判断是否调用 https://api.weixin.qq.com/sns/userinfo 此接口,
也就是 当 scope=snsapi_userinfo 才去执行doGetUserInfo 方法
参考:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html

已修复,1.6.6 版本待发布