Code Monkey home page Code Monkey logo

Comments (5)

crspybits avatar crspybits commented on May 22, 2024

In your case, how old was a "really old token"? I'm getting this error with an id token that was about 2 days old. Guess I'm not really sure how long they are supposed to last. The error did go away when I generated a new id token (signed out/signed back in) and used that with veryifyIdToken.

from google-auth-library-nodejs.

saibayadon avatar saibayadon commented on May 22, 2024

I don't recall right now, but I think that if you try to use a token that it's a day old you should get this error.

from google-auth-library-nodejs.

crspybits avatar crspybits commented on May 22, 2024

In the same verifyIdToken call, I'm now getting errors like "Token used too late, 1449031980.079 > 1449029024". I'm not sure if there is some variability in what gets returned from Google's servers, or if some change occurred to those servers.

I think these numbers are referring to the "exp" field of the IdToken, which has the definition:
"The time the ID token expires, represented in Unix time (integer seconds)."
(https://developers.google.com/identity/protocols/OpenIDConnect#obtainuserinfo)

I'll have to see if I can get the IdToken exp field immediately after obtaining the IdToken and convert the Unix time to a h/m/s time.

from google-auth-library-nodejs.

saibayadon avatar saibayadon commented on May 22, 2024

That is the expected behavior. If a token has expired, then you'll recieve that error. The issue that I'm describing is when instead of getting the correct error (Token userd too late) the pemVerify.verify call throws an error.

from google-auth-library-nodejs.

saibayadon avatar saibayadon commented on May 22, 2024

That error is to be expected if the token actually expired (You should check the expires_in field if there is any in your response). The issue I'm describing is that instead of getting the correct error (Token used too late) the perVerify.verify call throws an error due to the issue explained above.

If you're getting "Token used too late" you should refresh your access tokens.

from google-auth-library-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.