-1

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
pra5hant
  • 93
  • 1
  • 8

1 Answers1

2

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

  • Hi, I download code from the link which you have provided, all the other logins are working fine except "facebook login", now getting the different error, **Sorry, Something went wrong**, is it a known issue? I already have clear the cache and tried on a different browser. Thank you. – pra5hant Jul 14 '17 at 05:55
  • Sorry, It's my mistake I had put wrong Client Id, Thank you so much it's working now, But still, I can't figure it out what was the problem, another thing your app id and secret lay in the config file. – pra5hant Jul 14 '17 at 07:10