jaredhanson / passport-facebook

Facebook authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-facebook/?utm_source=github&utm_medium=referral&utm_campaign=passport-facebook&utm_content=about
MIT License
1.29k stars 446 forks source link

Passport.authentication() times out #259

Open jandraor opened 5 years ago

jandraor commented 5 years ago

I implemented a Facebook login strategy in an Express app using Oauth 2.0

It works fine on fast connections (Ethernet cable & 4G mobile) . However, in a slow connection (such as wi-fi) it keeps hanging after receiving the authorization code.

The server log shows GET /auth/facebook 302 & nothing else happens.

When it works, it fires the callback route "/auth/facebook/callback".

This is the url on the browser:

https://www.mywebsite.com/auth/facebook/callback?code=AQA7wUUnGkpsdFVs-PggQIbd809iOQ_B57oTSoKWmOe0JH9dsu4DI12IPP9Rr2jdVhSsWNexbhCy_Euy9pD0NGliY_zMEN3VPdRkiA4pnkeDLJyqWluuMxg4-khWagrKidgIK0GQW7-0MHkrCEyMvAnAucyNB5fnc2J2_byLSB6ELrfsBe-52jA4eLR6RFIshdLlO9qxTJmGH0JGU74a5zTNET9S52PaCUk6wEZD35Wl9zCLb5aaklOMiGm8JyW2KuoZnYkNYCEW6Yggr35eokXsMeJwqp_q2_qP4RQv82dhL47ZRX_da4MOPDPkyYTA4dc#=

It shows the error "Connection timed out".

I could trace where the flow gets stuck.

 router.get('/facebook', passport.authenticate('facebook', {
  scope : ['email']
}));

Please help.

timorss commented 4 years ago

Same, Did you solve the issue?

jandraor commented 4 years ago

I had a server centOS with Plesk pre-installed. Because I was only using the terminal, there were conflicts with Nginx. I had to reinstall centOS without Plesk, and everything worked fine. So, I suppose your problem could be with your web server.

timorss commented 4 years ago

I upload the server to heroku, works fine. Local host doesn't work