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 447 forks source link

Get Only Token from the Facebook Passport #230

Open mvgadagi opened 6 years ago

mvgadagi commented 6 years ago

Hi All,

I am very beginner in using the passport strategy and I just want to get only using the Facebook strategy how can I achieve this, I have tried the below code but didn't succeed

Like when I hit my custom API http://localhost:3000/graph/photos this should return me only token how can I get it done

    app.get('/graph/photos', passport.authenticate('facebook', (req, res) => {
        res.send(req.token);
    }));