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

3.0网页授权时scope为snsapi_base得不到openid #276

Closed
krissss opened this issue Feb 2, 2016 · 5 comments
Closed

3.0网页授权时scope为snsapi_base得不到openid #276

krissss opened this issue Feb 2, 2016 · 5 comments

Comments

@krissss
Copy link

krissss commented Feb 2, 2016

而且还会报48001错误

@overtrue
Copy link
Collaborator

overtrue commented Feb 2, 2016

@krissss 请贴你的用法,以及是否为 overtrue/socialite 最新版本

@krissss
Copy link
Author

krissss commented Feb 2, 2016

是最新版本
$options = array_merge(self::$_weixin_options,[
'oauth' => [
'scopes' => ['snsapi_base'],
'callback' => Url::to(['/we-chat/oauth-callback']),
],
]);
这是配置信息
然后在oauth-callback下使用
$oauthUser = $oauth->user();

  1. $wxOpenId = $oauthUser->getId(); // 这个获取得到的是null,并且报48001错误
  2. $wxOpenId = $oauthUser['token']['openid']; // 这个方式可以获取到

@overtrue
Copy link
Collaborator

overtrue commented Feb 3, 2016

@krissss 请扫描一下这个二维码,然后输入内容:oauth 把得到的结果截屏发我一下:

@terranc
Copy link

terranc commented Dec 18, 2018

同样遇到这个问题,是怎么解决的呀?

@scqrzdt
Copy link

scqrzdt commented Mar 31, 2022

5x也遇到这个问题

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

4 participants