OK, I\'m trying to use Hybridauth with laravel 4. However I seem to be getting the very common when trying to log in with facebook:
Authentication fai
My case was a little bit more specific, but just in case: Be carefull with redirects!
I had an SSL Certificate installed and a redirect to force the user over https
, but when I first configured HybridAuth I didn't took this into account. The facebook request was being redirected over to https
causing the $_REQUEST
data to be lost in the process.
For me the change was, in Hybrid/config.php
:
"base_url" => "http://my-site.com/"
to
"base_url" => "https://my-site.com/"
CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false
at modules/hybridauth/Hybrid/thirdparty/Facebook/base_facebook.php:128
solved!
CURLOPT_SSL_VERIFYPEER => false & resetting my app secret key didn't work for me. I was getting this error because of some conflict with privileges I had previously setup. Removing the app from my facebook account did the trick (under privacy settings -> apps).
REMOVE THE TRAILING SLASH !!! (in config/hybridauth.php)
"base_url" => "http://myapp.dev/social/auth/",
should be
"base_url" => "http://myapp.dev/social/auth",
This happened to me because my SSL is terminated in AWS's load balancer
Just update the config file in your app/config to include the trustForwarded setting
<?php
return array(
'base_url' => 'http://website.com/oauth/auth',
'providers' => array (
'Facebook' => array (
'enabled' => true,
'keys' => array ( 'id' => 'redacted', 'secret' => 'redacted' ),
'trustForwarded' => true,
),
),
);
I had the exact same error message on a wordpress installation using Hybridauth. To find the problem I set up an isolated test with the Facebook PHP SDK (which Hybridauth uses) just to find out that curl_exec
was not enabled on my host. Happily, an easy fix.
If you are on apache open you php.ini
and delete curl_exec
from this line:
disable_functions = curl_exec
Reload your apache configuration and voila :)
Hope this will help somebody.