passport-facebook Strategy.parseErrorResponse
我正在尝试设置Facebook身份validation,并且每次调用callback函数时都会收到一个错误,它会在/node_modules/passport-facebook/lib/strategy.js:196:12处引发一个Strategy.parseErrorResponse
没有消息告诉我什么是错的。 我检查,以确保我的clientID和秘密是正确的(正如我看到这可能发生,如果他们是错的)。
passport.use(new FacebookStrategy({ clientID: myId, clientSecret: mySeceret, callbackURL: callBackUrl, passReqToCallback : true }, (req, accessToken, refreshToken, profile, done) => { process.nextTick(() => { if (req.user) { done(null, req.user); if (!req.user.facebookId) { req.user.facebookId = profile.id; req.user.save().then(() => { done(null, req.user); }); } else { done(null, req.user); } } else { User.find({where: {facebookId: profile.id}}, function (err,user) { return done(err, user); }); } }); }));
我的路线
app.get('/auth/facebook', passport.authenticate('facebook', { scope: 'email' })); app.get('/auth/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/login' }), function (req, res) { res.redirect('/'); });
全栈
Error at Strategy.parseErrorResponse (/node_modules/passport-facebook/lib/strategy.js:196:12) at Strategy.OAuth2Strategy._createOAuthError (/node_modules/passport-oauth2/lib/strategy.js:376:16) at /node_modules/passport-oauth2/lib/strategy.js:166:45 at /node_modules/oauth/lib/oauth2.js:191:18 at passBackControl (/node_modules/oauth/lib/oauth2.js:132:9) at IncomingMessage.<anonymous> (/node_modules/oauth/lib/oauth2.js:157:7) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:188:7) at endReadableNT (_stream_readable.js:975:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickDomainCallback (internal/process/next_tick.js:128:9)
另外,它看起来像键被越过,因为它包含我可以看到被称为/ auth / facebook / callback的路线?code =“someReallyLongKey”
- 会话不能正确地从存储中获得,使用express-session和passportjs
- nodejs护照login
- 护照-Facebook上的风帆。 没有Facebooklogin页面
- MEAN堆栈如何处理login和redirect
- 谷歌oauth不返回电子邮件通行证authentication
- 在服务器端使用Passport-jwt呈现Express / React应用程序
- Express-mysql-session阻止passport deserializeUser运行
- 如何解决:Nodejs passport.header问题,req.session.passport未定义
- Node.js,express,护照authentication“Bad Request”