Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The token is not yet valid (iat) #824

Closed
aruehl opened this issue Nov 6, 2022 · 3 comments
Closed

The token is not yet valid (iat) #824

aruehl opened this issue Nov 6, 2022 · 3 comments

Comments

@aruehl
Copy link

aruehl commented Nov 6, 2022

Since upgrading to version 2.6.0 the decoding of my ID Token fails with:
jwt.exceptions.ImmatureSignatureError: The token is not yet valid (iat)

The token has valid values. For example:

{
  "exp": 1667737396,
  "iat": 1667737096,
  "auth_time": 1667732666,
  "jti": "ac4bb8fb-1c05-478f-ba61-99a78d7a3b84",
  "sub": "a50dbd90-fccf-42f6-b13d-04759e3e6ee4",
  "typ": "ID",
...

Epoch timestamp at calling the decode method was 1667737094. From client view the token is generated in the future.

Previous versions (2.4.0 and 2.5.0) are decoding the token susccessfully.

I have also tried options={"verify_aud": False, "verify_nbf": False}, but get the same error!

Did you changed any parameters of validation?

Reproduction Steps

import jwt

jwt.decode(token, signing_key, algorithms=["ES256", "RS256"], options={"verify_aud": False})

System Information

$ python -m jwt.help
{
  "cryptography": {
    "version": "38.0.1"
  "platform": {
    "release": "10",
    "system": "Windows"
  },
  "pyjwt": {
    "version": "2.6.0"
  }
}

@daillouf
Copy link
Contributor

daillouf commented Nov 7, 2022

this is a duplicate of #814
#814 got closed as the PR got closed but there was no release made yet.

Waiting for that release I suggest either putting leeway=1 in all your decode() calls, or limit your pyjwt <2.6.0 for now

@auvipy auvipy closed this as completed Nov 7, 2022
@CCodeInspect
Copy link

CCodeInspect commented Feb 1, 2023

this is a duplicate of #814 #814 got closed as the PR got closed but there was no release made yet.

Waiting for that release I suggest either putting leeway=1 in all your decode() calls, or limit your pyjwt <2.6.0 for now

this is a duplicate of #814 #814 got closed as the PR got closed but there was no release made yet.

Waiting for that release I suggest either putting leeway=1 in all your decode() calls, or limit your pyjwt <2.6.0 for now

Thanks and i also met this question and i just back to 2.5.0 and try again.

question:
raise ImmatureSignatureError("The token is not yet valid (iat)")
jwt.exceptions.ImmatureSignatureError: The token is not yet valid (iat)

@Abdullah9202
Copy link

jwt.decode(token, key=self.public_pem_key, algorithms=['RS256'], options={"verify_iat": False})

It worked for me but it's not recommended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants