private boolean sendData(boolean isUserName) {
    if (authentication != null) {
      sendData(isUserName ? authentication.getUserName() : authentication.getPassword());
    }
    else {
      cancelAuthentication();
    }

    return authentication != null;
  }
private boolean sendData(boolean isUserName)