@Override
    protected Object processResponse(final @NotNull Message msg,
        final @NotNull Connection connection) throws Exception {
      byte[] bytes;
      Part part = msg.getPart(0);
      final MessageType msgType = msg.getMessageType();
      long userId = -1;
      if (msgType == MessageType.RESPONSE) {
        bytes = (byte[]) part.getObject();
        if (bytes.length == 0) {
          connection.getServer().setRequiresCredentials(false);
        } else {
          connection.getServer().setRequiresCredentials(true);
          byte[] decrypted = ((ConnectionImpl) connection).decryptBytes(bytes);
          try (ByteArrayDataInput dis = new ByteArrayDataInput(decrypted)) {
            userId = dis.readLong();
          }
        }
        if (needsServerLocation) {
          return new Object[] {connection.getServer(), userId};
        } else {
          return userId;
        }
      } else if (msgType == MessageType.EXCEPTION) {
        Object result = part.getObject();
        String s = "While performing a remote authenticate";
        if (result instanceof AuthenticationFailedException) {
          final AuthenticationFailedException afe = (AuthenticationFailedException) result;
          if ("REPLY_REFUSED".equals(afe.getMessage())) {
            throw new AuthenticationFailedException(s, afe.getCause());
          } else {
            throw new AuthenticationFailedException(s, afe);
          }
        } else if (result instanceof AuthenticationExpiredException) {
          throw (AuthenticationExpiredException) result;
        } else if (result instanceof AuthenticationRequiredException) {
          throw new AuthenticationRequiredException(s, (AuthenticationRequiredException) result);
        } else if (result instanceof NotAuthorizedException) {
          throw new NotAuthorizedException(s, (NotAuthorizedException) result);
        } else {
          throw new ServerOperationException(s, (Throwable) result);
        }
        // Get the exception toString part.
        // This was added for c++ thin client and not used in java
      } else if (isErrorResponse(msgType)) {
        throw new ServerOperationException(part.getString());
      } else {
        throw new InternalGemFireError("Unexpected message type " + msgType);
      }
    }
Sends the auth credentials to the server for a particular user. Used in multiple user mode of
authentication.

@param location The ServerLocation instance whose connection instance will be used to perform
       the operation.
@param pool The connection pool to use for this operation.
@return Object unique user-id.
geode-core/src/main/java/org/apache/geode/cache/client/internal/AuthenticateUserOp.java