Monday 16 April 2018

Passport.js - using Google for authentication: do I have to use the refresh/access token?

My goal is to have a website where people can login using their Google account. I only extract some basic info such as their Google id, name and e-mail and save it in in a database. My plan is to re-use the record saved on my database whenever they sign in again with their Google account.At this moment, I have setup some code using Passport.js where users can login using their Google account and a callback method gets executed which contains the refresh token and access token and their profile data.If I understand correctly, I will only need the access token and refresh token if I actually call some other Google API. Is this correct?Since I don't want to do that, my plan is to save the access token in a database and save it as well on the client's side to be able to see whether they are authenticated.

Submitted April 16, 2018 at 09:55PM by ViceCity6

No comments:

Post a Comment