Open sinkcup opened 5 years ago
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
config/services.php
expected result:
result: