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

refresh_token undefined #252

Open davechappell opened 5 years ago

davechappell commented 5 years ago

Hi all, I'm trying to use a refresh token so that I can refresh my access token without requiring the user to log in every hour. With the following code, which gets executed during the facebook login process always shows the refresh_token as undefined. What am I missing?

const passport = require('passport'); const Strategy = require('passport-facebook').Strategy;

passport.use(new Strategy({ clientID: process.env.CLIENT_ID, clientSecret: process.env.CLIENT_SECRET, callbackURL: 'http://localhost:3000/login/facebook/return' }, function(accessToken, refreshToken, profile, cb) { console.log('accessToken: %s', accessToken); console.log('!!!!refreshToken!!!!: %s', refreshToken); // This is always undefined console.log('Profile: %j', profile); ... return cb(null, profile); }));

Thanks, Dave

aocenas commented 5 years ago

@davechappell did you find out what was the issue? Having the same issue myself at the moment.

aocenas commented 5 years ago

Seems like this is the reason (and a duplicate of) https://github.com/jaredhanson/passport-facebook/issues/8