public Cluster getClusterWithCredentials(String userName, Object credentials) {
    synchronized (clusterMap) {
      Cluster cluster = clusterMap.get(userName);
      if (cluster == null) {
        logger.info(resourceBundle.getString("LOG_MSG_CREATE_NEW_THREAD") + " : " + userName);
        cluster = clusterFactory.create(host, port, userName, resourceBundle, this);
        // Assign name to thread created
        cluster.setName(PulseConstants.APP_NAME + "-" + host + ":" + port + ":" + userName);
        cluster.connectToGemFire(credentials);
        if (cluster.isConnectedFlag()) {
          clusterMap.put(userName, cluster);
        }
      }
      return cluster;
    }
  }
this will return a cluster already connected to the geode jmx manager for the user in the
request
<p>
But for multi-user connections to gemfireJMX, i.e pulse that uses gemfire integrated security,
we will need to get the username from the context
geode-pulse/src/main/java/org/apache/geode/tools/pulse/internal/data/Repository.java