Skip to content

Commit

Permalink
Merge pull request #14 from moritz89/11-fix-_is_client_token_timed_out
Browse files Browse the repository at this point in the history
Fix _is_client_token_timed_out directly returning True when token cannot be decoded(merge request by @moritz89)
  • Loading branch information
uw-rvitorino authored Aug 25, 2022
2 parents 0d21594 + 464b6df commit 83b9605
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions django_keycloak/keycloak.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ def _is_client_token_timed_out(self):

# Get the public key from the identity provider, i.e., the keycloak server
decoded = self._decode_token(self._client_token, self.client_jwt_audience)
if not decoded:
return True
exp = datetime.fromtimestamp(decoded["exp"], tz=timezone.utc)
iat = datetime.fromtimestamp(decoded["iat"], tz=timezone.utc)
now = datetime.now(tz=timezone.utc)
Expand Down

0 comments on commit 83b9605

Please sign in to comment.