当我学习护照中间件时,我正在尝试将其与新的Express 4路由器()功能集成。
但在尝试使用passport-facebook中间件时,请使用代码:
router.route('/auth/facebook')
.get(passport.authenticate('facebook', {scope : 'email'}));
router.route('auth/facebook/callback')
.get( passport.authenticate('facebook', {
successRedirect : '/profile',
failureRedirect : '/'
}));
我遇到了以下问题:
Error: read ETIMEDOUT
at Strategy.OAuth2Strategy._createOAuthError (/Users/home/WorkSpaces/MEAN/EasyAuth/node_modules/passport-facebook/node_modules/passport-oauth2/lib/strategy.js:348:17)
at /Users/home/WorkSpaces/MEAN/EasyAuth/node_modules/passport-facebook/node_modules/passport-oauth2/lib/strategy.js:171:43
at exports.OAuth2.getOAuthAccessToken (/Users/home/WorkSpaces/MEAN/EasyAuth/node_modules/passport-facebook/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:177:18)
at ClientRequest.exports.OAuth2._executeRequest (/Users/home/WorkSpaces/MEAN/EasyAuth/node_modules/passport-facebook/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:148:5)
at ClientRequest.emit (events.js:95:17)
at CleartextStream.socketErrorListener (http.js:1551:9)
at CleartextStream.emit (events.js:95:17)
at Socket.onerror (tls.js:1455:17)
at Socket.emit (events.js:117:20)
at Socket._destroy.self._writableState.errorEmitted (net.js:440:14)
答案 0 :(得分:0)
查看
上的优秀教程 ETIMEDOUT
可能是无效的redirect_uri
,但很难从错误消息中判断出来。