【发布时间】:2015-09-25 13:27:24
【问题描述】:
在我的应用程序中,我注册了 facebook-strategie,如下所示: 但是返回的配置文件不包含电子邮件字段....
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 the following colsole.log
console.log(JSON.stringify(profile));
}));
get如下:
app.get('/oauth/facebook', passport.authenticate('facebook', {
failureRedirect: '/login',
scope:['email']
}));
(所以我使用这里所说的范围:Passport-facebook doesn't get email)
在 FB 登录页面上,我什至要求提供电子邮件,我确实提供了它:
非常感谢任何帮助!
【问题讨论】:
-
您还需要询问电子邮件字段
-
我该怎么做?我以为我会用
scope:['email'] -
scope:['email'] 是您想要的权限。当您致电 /me 时,您需要执行 /me?fields=email
标签: node.js facebook oauth passport.js facebook-oauth