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

Scope 参数错误或没有 Scope 权限 #528

Closed
zacksleo opened this issue Nov 23, 2016 · 9 comments
Closed

Scope 参数错误或没有 Scope 权限 #528

zacksleo opened this issue Nov 23, 2016 · 9 comments

Comments

@zacksleo
Copy link
Contributor

zacksleo commented Nov 23, 2016

Centos 7 PHP7-fpm Yii2

PHP 版本:
overtrue/wechat 版本:

问题及现象

调用用户授权登录方法时, 出现Scope 参数错误或没有 Scope 权限,

https://open.weixin.qq.com/connect/qrconnect?appid={appid}&redirect_uri={domain}&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect
@overtrue
Copy link
Collaborator

这是微信报的错,我解决不了。

@zacksleo
Copy link
Contributor Author

这个会是什么原因引起的呢?

@overtrue
Copy link
Collaborator

@zacksleo

  1. 你的 appid 不正确
  2. 用了其它账号的 appid
  3. 你用错了平台权限类型:公众平台与开放平台

@zacksleo
Copy link
Contributor Author

@overtrue 谢谢 , 我会仔细检查确认

@zacksleo
Copy link
Contributor Author

zacksleo commented Nov 23, 2016

在登录授权的时候, 我在代码中发现 位于 socialite/src/Providers/WechatProvider中59行:

如果scrop是snsapi_login, 会把oauth2/authorize替换为qrconnect, 这是为什么?

如果把这个去掉, 微信登录授权可以通过

使用qrconnect

qrconnect

使用oauth2/authorize

authorize

@overtrue
Copy link
Collaborator

overtrue commented Nov 23, 2016

@zacksleo 公众平台的权限里没有 snsapi_login 吧?那么你为啥要用它呢?

http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140842&token=&lang=zh_CN

image

@overtrue
Copy link
Collaborator

如果没弄清楚这俩平台的区别建议不要乱用哦,开放平台 https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419316505&token=&lang=zh_CN

@overtrue
Copy link
Collaborator

  • 公众平台只有:snsapi_base 与 snsapi_userinfo
  • 开放平台:snsapi_login

😞

@zacksleo
Copy link
Contributor Author

ok, 已经搞明白了, scope需要在Application的config里配置 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants