jaredhanson / passport-twitter

Twitter authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-twitter/?utm_source=github&utm_medium=referral&utm_campaign=passport-twitter&utm_content=about
MIT License
469 stars 130 forks source link

500 Error: failed to find request token in session #8

Closed neojp closed 12 years ago

jaredhanson commented 12 years ago

See discussion on #3.

Most likely cause is the redirect from Twitter coming back to a different domain. (For example: starting on 127.0.0.1 and having a callback URL that uses localhost).

Also, be sure that session support is enabled, so the request token can be stored.

Let me know if that fixes it.

psanzay commented 11 years ago

i am getting the same error again and again even after the above fix

failed to obtain access token (Error: getaddrinfo ENOTFOUND) at /home/xeroxlab/Balloons.IO/node_modules/passport-facebook/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth2.js:125:38 at exports.OAuth2.getOAuthAccessToken (/home/xeroxlab/Balloons.IO/node_modules/passport-facebook/node_modules/passport-oauth/node_modules/oauth/lib/oauth2.js:131:18) at ClientRequest.exports.OAuth2._request (/home/xeroxlab/Balloons.IO/node_modules/passport-facebook/node_modules/passport-oauth/node_modules/oauth/lib/oauth2.js:99:5) at ClientRequest.EventEmitter.emit (events.js:96:17) at CleartextStream.socketErrorListener (http.js:1411:9) at CleartextStream.EventEmitter.emit (events.js:96:17) at Socket.onerror (tls.js:1336:17) at Socket.EventEmitter.emit (events.js:126:20) at Socket.connect.require.lookup.addressType (net.js:699:16) at process.startup.processNextTick.process._tickCallback (node.js:244:9)

jaredhanson commented 11 years ago

Error: getaddrinfo ENOTFOUND

That error suggests that twitter.com cannot be resolved on your system. I'd recommend double checking your deployment, and making sure its not behind some proxy that is preventing DNS resolution or outgoing requests.

Failing that, what version of Node are you running, and how was it compiled?

Anubh commented 10 years ago

Hi i am getting this error please let me know how can i resolve it.

failed to obtain request token (Error: getaddrinfo ENOTFOUND) at /home/anubh/workspace/nodeJs/careprosper/node_modules/passport-linkedin/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth.js:196:36 at /home/anubh/workspace/nodeJs/careprosper/node_modules/passport-linkedin/lib/passport-linkedin/strategy.js:80:19 at ClientRequest. (/home/anubh/workspace/nodeJs/careprosper/node_modules/passport-linkedin/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:409:7) at ClientRequest.EventEmitter.emit (events.js:95:17) at CleartextStream.socketErrorListener (http.js:1547:9) at CleartextStream.EventEmitter.emit (events.js:95:17) at Socket.onerror (tls.js:1445:17) at Socket.EventEmitter.emit (events.js:117:20) at net.js:833:16 at process._tickCallback (node.js:415:13)

championswimmer commented 7 years ago

This is a very late answer, but I just figured another reason this can happen. When the guys who made express-session said that MemoryStore is not meant for production, they really meant it.

If you're using clustering, (pm2 or forever or running on Heroku), then memory based cookie storages have their own set of problems. You'll often loose cookies or corrupt them (because there are two or more separate processes on server side, not sharing common memory).

If you want to run your Node app with clusters, you need to use Redis or some DB-backed cookie storage