node.js - Passport-Facebook not providing email even if it is in scope -


in application register facebook-strategie follows: returned profile not contain email-field....

passport.use(new facebookstrategy({         clientid: config.facebook.clientid,         clientsecret: config.facebook.clientsecret,         callbackurl: config.facebook.callbackurl,         passreqtocallback: true     },     function(req, accesstoken, refreshtoken, profile, done) {         // no email in following colsole.log         console.log(json.stringify(profile));     })); 

the follows:

app.get('/oauth/facebook', passport.authenticate('facebook', {     failureredirect: '/login',     scope:['email'] })); 

(so using scope said here: passport-facebook doesn't email)

on fb-login page iam asked email , provide it: enter image description here

any appriciated!

from facebook graph apiv2.4, need explicitly specify fields get.

introducing graph api v2.4

so, can write like:

  passport.use(new facebookstrategy({       clientid: config.facebook.clientid,       clientsecret: config.facebook.clientsecret,       callbackurl: config.facebook.callbackurl,       profilefields: ['id', 'email', 'gender', 'link', 'locale', 'name', 'timezone', 'updated_time', 'verified'],     }, 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -