passport-facebook Failed to obtain access token

I am trying to register my users with Facebook using [email protected] following this example. My problem is that when the user is authenticated the response is:

Failed to obtain access token

Error: getaddrinfo ENOTFOUND at Strategy.OAuth2Strategy._createOAuthError /home/sigfried/github/passport-social/node_modules/passport-facebook/node_modules/passport-oauth2/lib/strategy.js:348:17)

I've checked my Express routes and everything seems to be fine. I checked the Network methods with Firefox and when the response come back to my server I've noticed an 500 Internal Server Error with this address: http://localhost:3000/login/facebook/callback?code=L4rg3H4sh#_=_

Upvotes: 1

Views: 1366

Answers (3)

I have got the same error on my localhost. After research I found the issue - it didn't work with my node.js (I had v18.12) after upgrade node.js to v19 it was fixed. Hope it helps

Upvotes: 0

Most likely I was trying to access an address in my localhost, so I think that the solution here would be to expose, with something like ngrok, my local server and then problem solved.

Hope this helps someone in a hurry or as naive as I was.

Upvotes: 0

Shivanand Mitakari
Shivanand Mitakari

Reputation: 515

check whether your ssl connection is blocking this..

Upvotes: 0

Related Questions