'Determine if the authentication is needed or if the existing token (if
any exists) is still valid.'

def _is_authentication_needed(self, force=False):

    if force:
        return True
    if (self.auth_version not in AUTH_VERSIONS_WITH_EXPIRES):
        return True
    if self.is_token_valid():
        return False
    return True
