Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
daixinbao opened this issue Oct 24, 2023 · 1 comment
Closed

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

daixinbao opened this issue Oct 24, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@daixinbao
Copy link

微信授权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

@daixinbao daixinbao added the bug Something isn't working label Oct 24, 2023
@zhangyd-c
Copy link
Member

已修复,1.6.6 版本待发布

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants