jpadilla/pyjwt

options verify_exp not working

itsMGA opened this issue · 1 comments

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

Version 2.8.0