diff --git a/openidc_client/__init__.py b/openidc_client/__init__.py index d8ff31d..ff8e817 100644 --- a/openidc_client/__init__.py +++ b/openidc_client/__init__.py @@ -405,7 +405,7 @@ def _refresh_token(self, uuid): :returns: True if the token was succesfully refreshed, False otherwise """ oldtoken = self._cache[uuid] - if not oldtoken['refresh_token']: + if not oldtoken.get('refresh_token'): self.debug("Unable to refresh: no refresh token present") return False self.debug('Refreshing token %s', uuid)