private ClusterData getClusterData() {
    //default value for unsecure clusters
    String keyTab = "NA";
    String principal = "NA";

    // cluster data is needed multiple times during the stage creation, cached it locally ...
    Map.Entry<String, Cluster> clustersMapEntry = clusters.getClusters().entrySet().iterator().next();

    Cluster cluster = clustersMapEntry.getValue();

    switch (cluster.getSecurityType()) {
      case KERBEROS:
        // get the principal
        Map<String, String> hadoopEnv = cluster.getDesiredConfigByType(HADOOP_ENV).getProperties();
        keyTab = hadoopEnv.get(HDFS_USER_KEYTAB);
        principal = hadoopEnv.get(HDFS_PRINCIPAL_NAME);
        break;
      case NONE:
        // break; let the flow enter the default case
      default:
        LOGGER.debug("The cluster security is not set. Security type: {}", cluster.getSecurityType());
        break;
    }


    return new ClusterData(cluster.getClusterName(), cluster.getClusterId(), cluster.getSecurityType().name(), principal, keyTab, getHdfsUser(cluster));
  }
Service in charge for handling user initialization related logic.
It's expected that this implementation encapsulates all the logic around the user initialization hook:
1. validates the context  (all the input is available)
2. checks if prerequisites are satisfied for the hook execution
3. triggers the hook execution flow
4. executes the flow (on a separate thread)
ambari-server/src/main/java/org/apache/ambari/server/hooks/users/UserHookService.java