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

后端 未结 10 1615
执念已碎
执念已碎 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:41

    For anyone else this is what worked for me: I reset app secret and now works great. No idea why my first app secret key did not work. Spent a ridiculous amount of time trying to fix this error.

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

    Had this error in the past. Solved by modyfying Hybridauth's code myself.

    1. In thirdparty/Facebook/base_facebook.php make sure $CURL_OPTS array uses: CURLOPT_SSL_VERIFYPEER => false
    2. In my case I was closing session files for performance improvements so I added: session_start() inside Storage.php wherever HA::STORE session var is being updated/unset.

    Let me know if it helps.

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

    In base_facebook.php do following

      public static $CURL_OPTS = array(
        CURLOPT_CONNECTTIMEOUT => 50,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT        => 60,
        CURLOPT_USERAGENT      => 'facebook-php-3.2',
        CURLOPT_SSL_VERIFYPEER => false,
        CURLOPT_SSL_VERIFYHOST => false,
      );
    
      protected $trustForwarded = true;
      protected $allowSignedRequest = false;
    
    0 讨论(0)
  • 2020-12-18 08:46

    I was having the same issue (although using HybridAuth on Yii) and turns out my app on Facebook was still in Sandbox mode. No source code changes needed on HybridAuth, just needed to turn off Sandbox Mode for the app and suddenly everything worked. Hope this helps.

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