2016-12-08 231 views
0

我正尝试在使用混合身份验证的我的laravel应用程序中添加google身份验证。laravel应用程序中的Google身份验证 - 混合身份验证错误

谷歌身份验证配置:

<?php 

return array(

    "base_url" => "https://mywebsite.com/gauth/auth", 
    "providers" => array(

     "Google" => array(

      "enabled" => true, 
      "keys" => array(
       "id" => "myid.apps.googleusercontent.com", 
       "secret" => "mysecret" 
      ), 
      "scope" => "https://www.googleapis.com/auth/userinfo.email " 

     ) 

    ) 

); 

认证在HTTP网站的罚款。但是当我添加SSL/HTTPS到网站它不工作,我得到以下错误:

Exception in Auth.php line 169: 
User profile request failed! Google returned an error: exception 'Exception' with message 'The Authorization Service has return: invalid_request' in /project/httpdocs/vendor/hybridauth/hybridauth/hybridauth/Hybrid/thirdparty/OAuth/OAuth2Client.php:84 

什么是导致此错误的问题?

+0

有没有理由不使用Laravel Socialite包来做到这一点?它是由泰勒奥特维尔专门为Laravel写的。 – Joe

+0

也许与[this other question]有关(http://stackoverflow.com/questions/40997264/hybridauth-with-google-provider-randomly-returns-invalid-request-when-authenti)? –

回答