Codeigniter + HAuth,身份验证失败! Facebook返回了无效的用户ID

时间:2017-07-11 08:52:23

标签: facebook codeigniter login userid hybridauth

我正在使用带有Codeigniter Framework的HybridAuth库,所有其他社交登录正常工作除了“Facebook社交登录”,我收到错误“身份验证失败!Facebook返回了无效的用户ID。”

我尝试了所有可用的答案,例如:

我从2天开始挣扎,并尝试了所有可能的答案,仍然无法弄清楚是什么问题,任何帮助都会非常明显。

注意: CURL在我的服务器上正常运行

更新

代码文件
config-> hybridauthlib.php

$config =
array(
    'base_url' => '/hauth/endpoint/',

    "providers" => array (
        "Facebook" => array (
            "enabled" => true,
            "keys"    => array ( "id" => "xxxxxxxx", "secret" => "xxxxxxxxxx" ),
        ),
);

Thirdparty-> hybridauth-> config.php中

return 
array(
"base_url" => "/hauth/endpoint/", 
"Facebook" => array ( 
            "enabled" => true,
            "keys"    => array ( "id" => "", "secret" => "" ),
            "trustForwarded" => true,
        ),

我也根据其他开发者的建议 third_party-> hybridauth-> Hybrid-> thirdparty-> facebook-> base_facebook.php 进行更改

    public static $CURL_OPTS = array(
      CURLOPT_CONNECTTIMEOUT => 30,
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_TIMEOUT        => 60,
      CURLOPT_USERAGENT      => 'facebook-php-3.2',
      CURLOPT_SSL_VERIFYPEER => false
   );
   protected $trustForwarded = true;
   protected $allowSignedRequest = false;

Facebook重定向URI

http://localhost/myproj/index.php/hauth/endpoint?hauth.done=Facebook

1 个答案:

答案 0 :(得分:2)

我也发现了同样的问题并解决了它。请转到以下网址: https://github.com/aviansh26dec/hauth