Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
check_claims = {
"jti": None,
"exp": None,
"iat": None,
}
signed_token = jwt.JWT(algs=['RS256'], check_claims=check_claims)
if leeway:
signed_token.leeway = leeway
signed_token.deserialize(jwt_token, key=public_jwk)
return json.loads(signed_token.claims)
except (InvalidJWSObject,
InvalidJWSSignature,
JWTInvalidClaimFormat,
JWTMissingClaim,
JWTExpired,
ValueError) as e:
raise InvalidTokenException(repr(e))