Dinushanka
Sep 1, 2018 · 1 min read

There are 2 ways you can do this. Implement the passport strategies called https://www.npmjs.com/package/passport-google-token in case of google and https://github.com/drudge/passport-facebook-token in case of facebook in your API. then you can send the client side obtained social token to your API to login. Do this if you dont want to use callbacks. Else you can completely avoid this by using passport-facebook and passport-google strategies in your API. This will ensure that the token exchange will be taken place completely in the server side. Refer this https://www.youtube.com/watch?v=w1xitaKDcI4

    Dinushanka

    Written by

    Software Engineer @ Caroobi https://www.dinushanka.me