Hi
I am intergrating facebook login in website, after login i got user details using following code
// 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: '//' + window.location.hostname + '/channel', // 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
var uid = "http://graph.facebook.com/" + response.authResponse.userID + "/picture";
FB.api('/me?fields=id,name,gender,email,first_name,last_name,birthday,hometown,location', function (me) {
document.getElementById('authdisplayname').innerText = me.name;
document.getElementById('Email').innerText = me.email;
document.getElementById('firstname').innerText = me.first_name;
document.getElementById('lastname').innerText = me.last_name;
document.getElementById('gender').innerText = me.gender;
//document.getElementById('profileImg').src = uid;
document.getElementById('birthday').innerText = me.birthday;
document.getElementById('hometown').innerText = me.hometown.name;
document.getElementById('location').innerText = me.location.name;
var someValueToPass = me.email;
__doPostBack('CustomPostBack', someValueToPass);
})
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(); }); });
}
Facebook Login Authentication Example
Now i want save these details in database using vb.net.... Anyone can guide
Thanks
Rajeesh MenothPosted Aug 31, 2016, 6:55 AM