I am trying to login to my website using my Facebook account but Facebook is giving name and id only that is not enough to login user. Before I was getting full information like firstname, lastname, email etc.
Data provided by facebook now:
stdClass Object
(
[name] => FName LName
[id] => 236189327864097
)
I am using Oauth v2.0 to login users through Facebook to my website.
FB.api('/me?fields=first_name, last_name, picture, email', function(response) {
console.log(response);
document.getElementById('status').innerHTML =
'Thanks for logging in, ' + response.first_name + '!';
});
This worked for me. Pass email after /me?fields= in FB.api request.
Pass by parameters the fields that you looking for:
var request = new OAuth2Request("GET", new Uri("https://graph.facebook.com/me?fields=birthday,email,name,id"), null, eventArgs.Account);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With