HybridAuth / PHP Facebook SDK authentication failed (getUser returns 0)

后端 未结 4 1133
终归单人心
终归单人心 2021-01-16 09:17

I\'m trying to configure HybridAuth and I\'m in the very early stages. Right now all I want to do is connect and make sure HA will redirect to facebook and prompt for app i

4条回答
  •  既然无缘
    2021-01-16 09:49

    I moved my code to a different app/server and then to the same app on a different server and everything worked fine. So I started looking into it as a server configuration issue. Turns out Facebook didn't like the self-signed certificate on my development server.

    I was able to solve this problem by altering the base_facebook.php class in the PHP SDK and adding the curlopt to ignore the SSL verification step. See below:

      public static $CURL_OPTS = array(
        CURLOPT_CONNECTTIMEOUT => 10,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT        => 60,
        CURLOPT_USERAGENT      => 'facebook-php-3.1',
        CURLOPT_SSL_VERIFYPEER => false
      );
    

提交回复
热议问题