Passport-Facebook authentication is not providing email for all Facebook accounts

前端 未结 7 942
忘了有多久
忘了有多久 2020-12-07 20:16

I am using Passport-Facebook authentication.

  passport.use(new FacebookStrategy({
            clientID: \'CLIENT_ID\',
            clientSecret: \'CLIENT_SECRET\         


        
7条回答
  •  情歌与酒
    2020-12-07 20:39

    When you are authenticating use something similar to this. You need to use add 'email' in the scope when you authenticate.

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

    That has worked for me.

    Here were a few links that helped me out.

    https://github.com/jaredhanson/passport-facebook/issues/11 https://github.com/jaredhanson/passport-facebook#how-do-i-ask-a-user-for-additional-permissions

提交回复
热议问题