Failed to get email, location, values using oauth.io
I am integrating facebook, twitter, github, linkedin using https://oauth.io/signin third party site. I have integrated facebook and was able to successfully get ids, names, gender properties directly, but I see difficulties in getting email address, location values.
In the oauth.io site, I even added permissions for facebook
I am using the below code to get the information of the registered user.
OAuth.popup('facebook')
.done(function (result) {
res = result;
result.me().done(function (response) {
debugger;
console.log('me ' + response.name);
console.log('me ' + response.email);
});
})
.fail(function (error) {
alert('fail');
});
I even tried filtering the results just to send email, date of birth values using
OAuth.popup('facebook')
.done(function (result) {
res = result;
result.me(['email', 'birthdate', 'location']).done(function (response) {
debugger;
console.log('me ' + response.name);
console.log('me ' + response.email);
});
})
.fail(function (error) {
alert('fail');
});
But it just returns an empty object. Can someone let me know if I am missing something?
+3
source to share
1 answer
I managed to get the required fields for facebook using
result.get('/me?fields=name,email,gender,birthday').done(function (response) {
console.log('me ' + response.name);
});
But the same code doesn't work for twitter. Still looking for an answer that works mostly for most of the apis
+3
source to share