protected void sendMessage(Connection cnx) throws Exception {
    if (cnx.getServer().getRequiresCredentials()) {
      // Security is enabled on client as well as on server
      getMessage().setMessageHasSecurePartFlag();
      long userId;

      if (UserAttributes.userAttributes.get() == null) { // single user mode
        userId = cnx.getServer().getUserId();
        if (userId == -1) {
          throw new ServerConnectivityException(
              "Invalid userId. Connection error while authenticating user");
        }
      } else { // multi user mode
        Long id = UserAttributes.userAttributes.get().getServerToId().get(cnx.getServer());
        if (id == null) {
          // This will ensure that this op is retried on another server, unless
          // the retryCount is exhausted. Fix for Bug 41501
          throw new ServerConnectivityException("Connection error while authenticating user");
        }
        userId = id;
      }
      secureLogger.debug("{} Using userId {}: ", getMessage().getMessageType(), userId);
      try (HeapDataOutputStream hdos = new HeapDataOutputStream(KnownVersion.CURRENT)) {
        hdos.writeLong(cnx.getConnectionID());
        hdos.writeLong(userId);
        getMessage().setSecurePart(((ConnectionImpl) cnx).encryptBytes(hdos.toByteArray()));
      }
    }
    getMessage().send(false);
  }
New implementations of AbstractOp should override this method if the implementation should be
excluded from client authentication. e.g. PingOp#sendMessage(Connection cnx)

@see AbstractOp#needsUserId()
@see AbstractOp#processSecureBytes(Connection, Message)
@see ServerConnection#updateAndGetSecurityPart()
geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java