Announcing Facebook Connect
At Facebook, we're committed to enabling people to communicate and stay connected wherever they go.
In August 2006, we introduced the first version of the Facebook API,
enabling users to share their information with the third party websites
and applications they choose. Hundreds of companies have leveraged these
APIs, allowing users to dynamically connect their identity information
from Facebook, such as basic profile, friends, photos information and
more, to third party websites, as well as desktop and mobile
applications.
In May 2007, we launched Facebook Platform, which allowed third party
developers to build rich social applications within Facebook. More than
350,000 developers and entrepreneurs from 225 countries have signed up,
and started developing applications, and have seen significant adoption
by Facebook users worldwide.
Today we are announcing Facebook Connect. Facebook Connect is the next
iteration of Facebook Platform that allows users to "connect" their
Facebook identity, friends and privacy to any site. This will now enable
third party websites to implement and offer even more features of
Facebook Platform off of Facebook – similar to features available to
third party applications today on Facebook.
Here are just a few of the coming features of Facebook Connect:
Trusted Authentication
Users will be able to connect their Facebook account with any partner
website using a trusted authentication method. Whether at login, or
anywhere else a developer would like to add social context, the user
will be able to authenticate and connect their account in a trusted
environment. The user will have total control of the permissions
granted.
Real Identity
Facebook users represent themselves with their real names and real
identities. With Facebook Connect, users can bring their real identity
information with them wherever they go on the Web, including: basic
profile information, profile picture, name, friends, photos, events,
groups, and more.
Friends Access
Users count on Facebook to stay connected to their friends and family.
With Facebook Connect, users can take their friends with them wherever
they go on the Web. Developers will be able to add rich social context
to their websites. Developers will even be able to dynamically show
which of their Facebook friends already have accounts on their sites.
Dynamic Privacy
As a user moves around the open Web, their privacy settings will follow,
ensuring that users' information and privacy rules are always
up-to-date. For example, if a user changes their profile picture, or
removes a friend connection, this will be automatically updated in the
external website.
These are just a few steps Facebook is taking to make the vision of
data portability a reality for users worldwide. We believe the next
evolution of data portability is about much more than data. It's about
giving users the ability to take their identity and friends with them
around the Web, while being able to trust that their information is
always up to date and always protected by their privacy settings.
We look forward to working with other leading identity providers to
develop the best policies and standards for enabling the portability and
protection of users' information.
1)You need an app id
2)You can get app id from developer.facebook.com
3)Create a new app in developer.facebook.com,there you will get the app id.
This a working code
<html>
<head runat="server">
<title>Facebook Login Authentication Example</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body style="height: 625px; width: 1316px; background-color:White;">
<script>
// Load the SDK Asynchronously
(function (d) {
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) { return; }
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
} (document));
// Init the SDK upon load
window.fbAsyncInit = function () {
FB.init({
appId: '**************', // App ID
channelUrl: 'channel.htm', // Path to your Channel File
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
// listen for and handle auth.statusChange events
FB.Event.subscribe('auth.statusChange', function (response) {
if (response.authResponse) {
// user has auth'd your app and is logged into Facebook
FB.api('/me', function (me) {
alert('Your name is ' + response.name);
if (me.name) {
document.getElementById('auth-displayname').innerHTML = me.name;
document.getElementById('auth-email').innerHTML=me.email;
document.getElementById('auth-gender').innerHTML=me.gender;
}
})
document.getElementById('auth-loggedout').style.display = 'none';
document.getElementById('auth-loggedin').style.display = 'block';
} else {
// user has not auth'd your app, or is not logged into Facebook
document.getElementById('auth-loggedout').style.display = 'block';
document.getElementById('auth-loggedin').style.display = 'none';
}
});
$("#auth-logoutlink").click(function () { FB.logout(function () { window.location.reload(); }); });
}
</script>
<h1>
Facebook Login Authentication Example</h1>
<div id="auth-status">
<div id="auth-loggedout">
<div class="fb-login-button" autologoutlink="true" scope="email,user_checkins">Login with Facebook</div>
</div>
<div id="auth-loggedin" style="display: none">
Hi, <span id="auth-displayname"></span>(<a href="#" id="auth-logoutlink">logout</a>)
<span id="auth-email"></span>
<span id="auth-gender"></span>
</div>
</div>
</body>
</html>