laravel4 hybridauth facebook Authentication failed! Facebook returned an invalid user id

后端 未结 10 1614
执念已碎
执念已碎 2020-12-18 07:51

OK, I\'m trying to use Hybridauth with laravel 4. However I seem to be getting the very common when trying to log in with facebook:

Authentication fai

相关标签:
10条回答
  • 2020-12-18 08:31

    My case was a little bit more specific, but just in case: Be carefull with redirects!

    I had an SSL Certificate installed and a redirect to force the user over https, but when I first configured HybridAuth I didn't took this into account. The facebook request was being redirected over to https causing the $_REQUEST data to be lost in the process.

    For me the change was, in Hybrid/config.php:

    "base_url" => "http://my-site.com/"

    to

    "base_url" => "https://my-site.com/"

    0 讨论(0)
  • 2020-12-18 08:35

    CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false

    at modules/hybridauth/Hybrid/thirdparty/Facebook/base_facebook.php:128

    solved!

    0 讨论(0)
  • 2020-12-18 08:35

    CURLOPT_SSL_VERIFYPEER => false & resetting my app secret key didn't work for me. I was getting this error because of some conflict with privileges I had previously setup. Removing the app from my facebook account did the trick (under privacy settings -> apps).

    0 讨论(0)
  • 2020-12-18 08:35

    REMOVE THE TRAILING SLASH !!! (in config/hybridauth.php)

    "base_url" => "http://myapp.dev/social/auth/",

    should be

    "base_url" => "http://myapp.dev/social/auth",

    0 讨论(0)
  • 2020-12-18 08:35

    This happened to me because my SSL is terminated in AWS's load balancer

    Just update the config file in your app/config to include the trustForwarded setting

    <?php
    
    return array(
        'base_url'   => 'http://website.com/oauth/auth',
        'providers'  => array (
            'Facebook'   => array (
                'enabled'    => true,
                'keys'       => array ( 'id' => 'redacted', 'secret' => 'redacted' ),
                'trustForwarded' => true,
            ),
        ),
    );
    
    0 讨论(0)
  • 2020-12-18 08:40

    I had the exact same error message on a wordpress installation using Hybridauth. To find the problem I set up an isolated test with the Facebook PHP SDK (which Hybridauth uses) just to find out that curl_exec was not enabled on my host. Happily, an easy fix.

    If you are on apache open you php.ini and delete curl_exec from this line:

    disable_functions = curl_exec
    

    Reload your apache configuration and voila :)

    Hope this will help somebody.

    0 讨论(0)
提交回复
热议问题