Skip to content

Commit

Permalink
fix: Leeway config (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
claeyswo authored Jun 4, 2024
1 parent 210d576 commit ec1affa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/keycloak/keycloak_openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,11 @@ def decode_token(self, token, validate: bool = True, **kwargs):
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)
Expand Down

0 comments on commit ec1affa

Please sign in to comment.