错误:无法在passport-twitter的会话中找到请求令牌

时间:2014-06-27 10:23:40

标签: node.js session express passport.js passport-twitter

以下是我在使用passport-twitter -

时遇到的错误
Error: Failed to find request token in session
    at Strategy.OAuthStrategy.authenticate (/MYPROJECT/node_modules/passport-twitter/node_modules/passport-oauth1/lib/strategy.js:142:54)
    at Strategy.authenticate (/MYPROJECT/node_modules/passport-twitter/lib/strategy.js:85:40)
    at attempt (/MYPROJECT/node_modules/passport/lib/middleware/authenticate.js:337:16)
    at Object.authenticate [as handle] (/MYPROJECT/node_modules/passport/lib/middleware/authenticate.js:338:7)
    at next_layer (/MYPROJECT/node_modules/express/lib/router/route.js:103:13)
    at Route.dispatch (/MYPROJECT/node_modules/express/lib/router/route.js:107:5)
    at /MYPROJECT/node_modules/express/lib/router/index.js:205:24
    at Function.proto.process_params (/MYPROJECT/node_modules/express/lib/router/index.js:269:12)
    at next (/MYPROJECT/node_modules/express/lib/router/index.js:199:19)
    at next (/MYPROJECT/node_modules/express/lib/router/index.js:176:38)

以下是我实施的Scotch Twitter Signup教程,FB signup工作正常。

FYI -

我在twitter上多次检查配置,一切似乎都没问题(callbackURL,密钥,秘密等)。

我检查了以下URL,但没有运气。

我的开发网址就像 - http://192.XXX.XXX.XX:PORT_NUMBER

以下是我的app.js app.js

以下是我的passport.js passport.js

以下是我的model.js buyer.js

让我知道我做错了什么,因为我现在完全迷失了错误:(

1 个答案:

答案 0 :(得分:1)

我也是这样。这对我有所帮助:

https://github.com/jaredhanson/passport-twitter/issues/45#issuecomment-66934259

它是从localhost:300调用但我的回调URL设置为127.0.0.1:3000。我将我的回调URL更改为localhost:3000,问题解决了。