I am using Hybrid Auth to login to facebook, twitter and linkedin but at first i get exception "No provider ID specified." but when i go back and try again it works fine weird :(. here's my code
{
session_start();
$config = dirname(__FILE__).
'/hybridauth/config.php';
require_once("hybridauth/Hybrid/Auth.php");
$db = new DB_Functions();
try {
// echo "store provider in session";
$_SESSION["provider"] = $_POST["provider"];
$provider = $_POST["provider"];
//echo " init hauth\n";
$hybridauth = new Hybrid_Auth($config);
// authenticate the current user with Twitter
//echo "before login\n"+$provider;
$auth_provider = $hybridauth - > authenticate($_POST["provider"]);
// $hybridauth = new Hybrid_Auth( $config );
//echo "after login\n";
// echo "get hauth session";
// echo $_POST["provider"];
$hybridauth_session_data = $hybridauth - > getSessionData();
// echo (string)$hybridauth_session_data;
//GET UNIQUE INDENTIFIER FROM USER PROFILE
// echo "get user ID";
$user_profile = $auth_provider - > getUserProfile();
$identifier = $user_profile - > profileURL;
if (!$db - > isUserExisted($identifier)) {
// then store it on your database or somethin
$res = $db - > store_hybridauth_session($_SESSION["provider"], $hybridauth_session_data, $identifier);
// echo "<br/> DB insert query Result:".$res." mysqli error: ".mysqli_error();
$auth_provider - > logout();
//redirect
} else {
$auth_provider - > logout();
//redirect
}
} catch (Exception $e) {
echo "Ooophs, we got an error: ".$e - > getMessage().
" go back and try again";
}
}
I found your error.this error in auth.php file. That file contains like this code below
So you should did mistake in this place google. you want to change your social network.. if you are using facebook,you must put in this place Facebook.Thank you.