Home >Backend Development >PHP Tutorial >Laravel 5.2 uses WeChat in Socialite Providers to log in. You can jump to WeChat to display the QR code, but the user information cannot be obtained.

Laravel 5.2 uses WeChat in Socialite Providers to log in. You can jump to WeChat to display the QR code, but the user information cannot be obtained.

WBOY
WBOYOriginal
2016-07-06 13:52:331795browse

The package used is this https://github.com/SocialiteProviders/Weixin-Web

The code is as follows:

<code class="php">public function weixin()
    {
        return \Socialite::with('weixinweb')->redirect();
    }

public function weixin_callback() {
        
        $oauthUser = \Socialite::driver('weixinweb')->user();
        var_dump($oauthUser);
        
    }</code>

Has anyone ever used WeChat login in Socialite Providers?

Prompt after callback:
Laravel 5.2 uses WeChat in Socialite Providers to log in. You can jump to WeChat to display the QR code, but the user information cannot be obtained.

Reply content:

The package used is this https://github.com/SocialiteProviders/Weixin-Web

The code is as follows:

<code class="php">public function weixin()
    {
        return \Socialite::with('weixinweb')->redirect();
    }

public function weixin_callback() {
        
        $oauthUser = \Socialite::driver('weixinweb')->user();
        var_dump($oauthUser);
        
    }</code>

Has anyone ever used WeChat login in Socialite Providers?

Prompt after callback:
Laravel 5.2 uses WeChat in Socialite Providers to log in. You can jump to WeChat to display the QR code, but the user information cannot be obtained.

Just use the following version. It should be a version conflict or compatibility issue.

<code>        "socialiteproviders/manager": "2.1.2",
        "socialiteproviders/weibo": "2.0.1",
        "socialiteproviders/qq": "2.0.3",
        "socialiteproviders/weixin-web": "2.0.1",
        "socialiteproviders/weixin": "2.1.1",</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn