Login Facebook using C# ASPX
I'm trying to log in to Facebook using aspx but i can't get the email from Facebook plugin log in so 开发者_StackOverflowany one have a sample for that.
all i want to get the email in variable.
What you need is here
I have created this code. Hopefully it will help you; it works for me and it gets the e-mail after login.
<fb:login-button autologoutlink="true" perms="email,user_birthday,status_update,publish_stream"></fb:login-button>
Script code is:
FB.login(function(response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
alert(response.email);
});
FB.logout(function(response) {
console.log('Logged out.');
});
});
} else {
console.log('User cancelled login or did not fully authorize.');
}
}, {scope: 'email'});
精彩评论