我正在使用Firebase托管来托管我的动态网站。 我使用facebook-passport通过Facebook进行身份验证,但是FacebookStrategy回调错误:
错误:
{
"name":"InternalOAuthError",
"message":"Failed to obtain access token",
"oauthError":{
"errno":"EAI_AGAIN",
"code":"EAI_AGAIN",
"syscall":"getaddrinfo",
"hostname":"graph.facebook.com",
"host":"graph.facebook.com",
"port":443
}
}
我的路线:
app.get('/sign-in/facebook', passport.authenticate('facebook', { scope:['email'] }));
app.get('/sign-in/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/sign-in', failureFlash: true }),
(req, res) => {
res.redirect('../../user/account');
},
err,req,res,next)=>{
res.send(err);
res.end();
}
);
我的护照:
passport.use(new FacebookStrategy({
clientID: config.FACEBOOK.clientID,
clientSecret: config.FACEBOOK.clientSecret,
callbackURL: config.host_name+"/sign-in/facebook/callback", //config.host_name+
profileFields: ['id', 'displayName', 'picture.type(large)', 'emails'],
enableProof: true,
},
function(accessToken, refreshToken, profile, done) {
process.nextTick(function () {
AuthorService.loginWithGoogleSrv(profile, (err, user)=>{
return done(err, user);
})
});
}
));
这里可能是什么问题。应用程序已上线。谢谢!