private static String setZookeeperClientKerberosJaasConfig(
      String saslLoginContextName, String zkPrincipal, String zkKeytab) throws IOException {
    // ZooKeeper property name to pick the correct JAAS conf section
    System.setProperty(ZooKeeperSaslClient.LOGIN_CONTEXT_NAME_KEY, saslLoginContextName);

    String principal = SecurityUtil.getServerPrincipal(zkPrincipal, "0.0.0.0");
    JaasConfiguration jaasConf = new JaasConfiguration(
        saslLoginContextName, principal, zkKeytab);

    // Install the Configuration in the runtime.
    javax.security.auth.login.Configuration.setConfiguration(jaasConf);
    return principal;
  }
Dynamically sets up the JAAS configuration that uses kerberos.

@param zkPrincipal
@param zkKeytab
@throws IOException
llap-client/src/java/org/apache/hadoop/hive/registry/impl/ZookeeperUtils.java