ecdsa.com
PyJWT (Python)JWT libraries

Error message

Signature has expired

PyJWT (Python) — jwt.exceptions.ExpiredSignatureError

What it means

The token's exp claim is earlier than the verifier's current time, so PyJWT rejected it after (conceptually) a successful signature check. The wording is slightly misleading — the signature itself does not expire; the token's validity window has closed.

Why it happens

How to fix it

  1. 1.

    Absorb small skew with leeway

    The leeway parameter (seconds) applies to exp and nbf checks. Use tens of seconds at most; larger values quietly extend token lifetimes.

    python
    import jwt
    
    payload = jwt.decode(
        token, key,
        algorithms=["ES256"],
        leeway=30,   # seconds of tolerated clock skew
    )
  2. 2.

    Inspect the actual timestamps

    Read the claims without verification and compare exp against the host clock — the gap size tells you whether it is expiry, skew, or an issuing bug.

    python
    import jwt, time
    claims = jwt.decode(token, options={"verify_signature": False})
    print("exp:", claims["exp"], "now:", int(time.time()),
          "delta:", int(time.time()) - claims["exp"], "s")

Related errors

← Browse the full signature error database