我正在使用带有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 进行更改/ p>
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