Authenticating With Facebook using Passport Not Working Authenticating With Facebook using Passport Not Working express express

Authenticating With Facebook using Passport Not Working


The problem was I didn't attach the domain name (in my case it is http://localhost:8080) in Facebook app settings.

Go to the Settings page under the Basic tab

  1. Click "+ Add Platform" and choose "Website"
  2. In the box that comes up for the website you just added: Site URL: http://localhost:8080/
  3. In the box above that (Settings => Basic): App Domain: localhost
  4. At the bottom right - click "Save Changes"

Once I done that my problem get solved.


 app.get('/auth/facebook', passport.authenticate('facebook', { scope : 'email' }));

Also, the above should be changed to:

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