Authenticate again after failure.
           Keep trying with 10 sec interval. If called from the notify thread
           we will not have a timeout, but will end if the notify thread has
           been cancled.
           Will return True if authentication was successful.

def re_authenticate(self, notify: bool=False) -> bool:
        """Authenticate again after failure.
           Keep trying with 10 sec interval. If called from the notify thread
           we will not have a timeout, but will end if the notify thread has
           been cancled.
           Will return True if authentication was successful.
          """
        timeout = datetime.now() + \
            timedelta(seconds=self.reauthenticatetimeout)
        while True:
            if self.authenticate():
                return True

            if notify:
                if not self._notifyrunning:
                    return False
            else:
                if timeout and datetime.now() > timeout:
                    return False
            # wait before we try to authenticate again
            time.sleep(self.retryinterval)