Profile and refresh token coming empty
I am not able to get profile and refresh token. Here is the code:
`app.get('/auth/example', passport.authenticate('provider', { scope: ['email'] }));
app.get('/auth/example/callback', passport.authenticate('provider', { failureRedirect: '/login' }), function(req, res) { // Successful authentication, redirect home. console.log("authentication done"); res.redirect('/oauthToken'); });`
passport.use('provider',new OAuth2Strategy({ authorizationURL: 'http://localhost:3000/dialog/authorize', tokenURL: 'http://localhost:3000/oauth/token', clientID: 'abc123', clientSecret: 'ssh-secret', callbackURL: "http://localhost:3001/auth/example/callback", passReqToCallback: true }, function(req,accessToken, refreshToken, profile, cb) { console.log(accessToken+" "+refreshToken+" "+profile); user.findOrCreate({ profile: profile }, function (err, user) { console.log(user); return cb(err, user); }); } ));
Please suggest. I am using oauth2orize to implement oauth server.