passport-facebook
passport-facebook copied to clipboard
Facebook allow Email scope not working, It's not return "email" ?
Scope allow :
app.get('http://localhost/authentication/facebook', passport.authenticate('facebook', {
scope: ['email', 'public_profile']
}));
Result:
{
id: '5900246411513451',
username: undefined,
displayName: 'John Wick',
name: { familyName: 'Wick', givenName: 'John', middleName: undefined },
gender: undefined,
profileUrl: undefined,
}
Why without email
return ????
You have to tell the library which fields from the profile to fetch, using the profileFields
option when you call the FacebookStrategy
constructor:
new FacebookStrategy({
clientID,
clientSecret,
callbackURL,
profileFields: ['id', 'email', 'name'],
})
I am also trying the same thing but it doesn't work even with the 'email' field inside the 'profileFields'
Hey, did someone come with solution?
Hey, did someone come with solution?
Hi bro, I can fix by add Permissions. Must allow Permissions facebook profile fields : https://developers.facebook.com/docs/graph-api/reference/v13.0/user#readperms
new FacebookStrategy({
clientID,
clientSecret,
callbackURL,
profileFields: ['id', 'email', 'name'],
})