Yii2 Google 0auth2 URI 重定向问题

Yii2 Google 0auth2 URI redirect issue

我通过 0auth2 为我的应用程序创建了一个 G+ 登录凭据。

 'google' => [
            'class' => 'yii\authclient\clients\GoogleOAuth',
            'clientId' => '*****************',
            'clientSecret' => 'j*************',
        ],  

以上代码来自我的config/web.php。这是我在控制器中的操作

'auth' => [
            'class' =>'yii\authclient\AuthAction',
            'successCallback' => [
            $this, 'successCallback'
            ],  

一切都很好..但返回时出现一些错误。
错误是
错误:redirect_uri_mismatchThe 请求中的重定向 URI:http://localhost/mysite/site/auth?authclient=google 与注册的重定向 URI 不匹配。
任何人都可以告诉我为什么会这样以及我错过了什么......
谢谢。

您还可以在您的身份验证客户端配置中明确添加 returnUrl。查看 docs 了解更多信息。