How do you combine Passport.js social login with JWT?

Viewed 1219

I used this tutorial to implement local, Facebook, Twitter, and Google login strategies: https://scotch.io/tutorials/easy-node-authentication-facebook

Then read this one about JWT: https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokens

The first tutorial seems to use sessions. My question is how do you combine the two e.g. a Facebook login that spits back a JWT (if that is even the correct thing to do)?

Also, is this the same thing as "Bearer" token? Ultimately what I am trying to do is client passes Authorization: Bearer ab123ncoiwuencr (http://dev.apollodata.com/react/auth.html#Header) that was granted by the server with local and social logins and the server validates it. I'm confused whether JWT is the right approach.

0 Answers
Related