jmreyes / passport-google-id-token

Google ID token authentication strategy for Passport and Node.js.
MIT License
44 stars 22 forks source link

401 Unauthorized #7

Closed remirobert closed 8 years ago

remirobert commented 8 years ago

Hello,

I used your module to authenticate my user from mobile. So I got the access token throw the google SDK, in the mobile side. I sent it to my API throw a POST request with the argument access_token.

I got an error in your module here:

var decodedToken = jwt.decode(idToken, {complete: true, json: true});

I checked the idToken is well filled with my token passed throw the http POST request.

For the passport strategy, I just provide the google ID:

passport.use(new GoogleTokenStrategy({
    clientID: configAuth.google.appID
  },...

Thanks in advance for your help.

jmreyes commented 8 years ago

Hi! What kind of error are you getting? That line should call this method from the jsonwebtoken module. You could also try to decode the token using e.g. https://jwt.io/ and tell me about its structure, so that I can try to replicate the problem. Thanks!

remirobert commented 8 years ago

It's okay ! In fact my access_token wasn't the good one. It works fine, with the good one. Thanks :+1: