Further to my Single Sign-on with Facebook LinkedIn GMail post, below is a single page example of how to authenticate, authorize and obtain user data such as an email address with Facebook's OAuth API written in PHP.


email) {

// Code to handle successful authentication. 
echo("
$user->name:  - $user->email  - authorized 

-signing in now...");
// Take user to main page.
echo "<script> setTimeout(function(){window.location='/'}, 3000);</script>";
}
else {

// Code to handle failure or refusal.

echo "Something went wrong while trying to authorize your account with Facebook.";
}
?>

0 comments:

Dynamic Page QR Code

Popular Posts

My LinkedIn PingTag


View My Stats