jpadilla / pyjwt

JSON Web Token implementation in Python
https://pyjwt.readthedocs.io
MIT License
5.1k stars 682 forks source link

options verify_exp not working #937

Closed itsMGA closed 8 months ago

itsMGA commented 8 months ago

With depreciation of verify bool, to bypass signature expiration exception, using options={'verify_exp': expired} does not work

I use it as such: return jwt.decode(jwt=token, key=self.kid, algorithms=[alg], audience=self.aud, options={'verify_exp': expired})

Stacktrace:


    def _validate_exp(
        self,
        payload: dict[str, Any],
        now: float,
        leeway: float,
    ) -> None:
        try:
            exp = int(payload["exp"])
        except ValueError:
            raise DecodeError("Expiration Time claim (exp) must be an" " integer.")

        if exp <= (now - leeway):
>           raise ExpiredSignatureError("Signature has expired")
E           jwt.exceptions.ExpiredSignatureError: Signature has expired
itsMGA commented 8 months ago

Version 2.8.0