facebookcodeigniterauthenticationuseridhybridauth

Codeigniter + HAuth, Authentication failed! Facebook returned an invalid user id


I am using HybridAuth Library with Codeigniter Framework, All the other Social login are working properly Except "Facebook Social Login", I am getting the error "Authentication Failed! Facebook returned an invalid user Id."

I Tried all available Answers, Like:

I am struggling from 2 days, and tried all the possible answers, still can't figure it out what is the problem, any help will be really appreciable.

Note: CURL is working properly on my server

Update

Code File
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,
        ),

I have also do changes in third_party->hybridauth->Hybrid->thirdparty->facebook->base_facebook.php as suggested by other developers

    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 Redirect URIs

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

Solution

  • I have also found same issue and resolve it. Please go to this URL: https://github.com/aviansh26dec/hauth