Saturday 31 August 2019

How can I use the Google OAuth2 ID token with node.js / passport.js to verify if the user is valid and authenticated?

On my front end, I'm using vue.js (not that that matters) and with the Google OAuth flow, I get back an id_token from:

let googleAuthIdToken = await this.auth2.currentUser
            .get()
            .getAuthResponse().id_token;

I want to then pass that token to my node.js server (Express / Passport) to verify that the user is allowed to login.

I want to use passport and send back a JWT to the front end in my response.

Can someone please guide me as to how to accomplish this?



from How can I use the Google OAuth2 ID token with node.js / passport.js to verify if the user is valid and authenticated?

No comments:

Post a Comment