简体   繁体   English

在nodejs中使用passport-facebook加载facebook friends_list?

[英]load facebook friends_list using passport-facebook in nodejs?

app.get('/auth/facebook', passport.authenticate('facebook', {
    authType: 'rerequest', 
    scope: ['email', 'user_friends']
}));

the request message is successfully sent to the logged-in user. 请求消息已成功发送到登录用户。

but there is no way to load & use that friend_list data in my nodejs application since passport-facebook profileFields does not support friend_list. 但是没有办法在我的nodejs应用程序中加载和使用那个friend_list数据,因为password-facebook profileFields不支持friend_list。

passport.use(new FacebookStrategy({
    clientID: process.env.FACEBOOK_CLIENTID,
    clientSecret: process.env.FACEBOOK_SECRETCODE,
    callbackURL: "http://localhost:3000/auth/facebook/callback",
    profileFields: ['id', 'displayName', 'photos', 'email']
},(accessToken, refreshToken, profile, done) => {
    console.log(profile);
    done(null, profile);
}));

is not there any way to solve this problem? 有没有办法解决这个问题?

do I have to use another options like javascript sdk on client-side or something new? 我是否必须在客户端使用其他选项,例如javascript sdk或其他新选项? need some advice 需要一些建议

好吧,我会使用请求模块向Facebook api发出发布请求,并解析出用户朋友。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM