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: WeChat Service Account scope snsapi_base conflict with snsapi_userinfo #10

Open
sinkcup opened this issue Jul 24, 2019 · 0 comments · Fixed by SocialiteProviders/Providers#329
Assignees
Labels
bug Something isn't working

Comments

@sinkcup
Copy link
Member

sinkcup commented Jul 24, 2019

config/services.php

    'wechat_service_account' => [
        'client_id' => env('WECHAT_SERVICE_ACCOUNT_APP_ID'),
        'client_secret' => env('WECHAT_SERVICE_ACCOUNT_APP_SECRET'),
        'redirect' => env('WECHAT_SERVICE_ACCOUNT_CALLBACK_URL'),
        'scopes' => 'snsapi_base',
    ],
    public function redirectToProvider($provider)
    {
        return Socialite::driver($provider)
            ->scopes(config("services.{$provider}.scopes"))
            ->redirect();
    }

expected result:

https://open.weixin.qq.com/connect/oauth2/authorize?redirect_uri=http%3A%2F%2Fexample.com%2Flogin%2Fwechat-service-account%2Fcallback&scope=snsapi_base&response_type=code&state=asdf&appid=wxdb123456

result:

https://open.weixin.qq.com/connect/oauth2/authorize?redirect_uri=http%3A%2F%2Fexample.com%2Flogin%2Fwechat-service-account%2Fcallback&scope=snsapi_userinfo%2Csnsapi_base&response_type=code&state=asdf&appid=wxdb123456

image

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

Successfully merging a pull request may close this issue.

1 participant