def is_token_expired(self): """ Returns ``True`` if the token is expired, ``False`` if not, and ``None`` if there is no token set. """ if self.token is None: return None return not utils.check_token_expiration(self.token)
def check_auth_expiry(self, auth_ref): if not utils.check_token_expiration(auth_ref): msg = _("The authentication token issued by the Identity service " "has expired.") LOG.warning("The authentication token issued by the Identity " "service appears to have expired before it was " "issued. This may indicate a problem with either your " "server or client configuration.") raise exceptions.KeystoneAuthException(msg) return True
def is_authenticated(self): """ Checks for a valid token that has not yet expired. """ return (self.token is not None and utils.check_token_expiration(self.token))