Browse Source

fix: Leeway config (#568)

pull/569/head v4.0.1
Wouter Claeys 7 months ago
committed by GitHub
parent
commit
ec1affa1df
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      src/keycloak/keycloak_openid.py

4
src/keycloak/keycloak_openid.py

@ -548,7 +548,11 @@ class KeycloakOpenID:
key = jwk.JWK.from_pem(key.encode("utf-8"))
kwargs["key"] = key
key = kwargs.pop("key")
leeway = kwargs.pop("leeway", 60)
full_jwt = jwt.JWT(jwt=token, **kwargs)
full_jwt.leeway = leeway
full_jwt.validate(key)
return jwt.json_decode(full_jwt.claims)
else:
full_jwt = jwt.JWT(jwt=token, **kwargs)

Loading…
Cancel
Save