private void getCredentialsFromSuppliers(BaseWork work, Set<TableDesc> tables, DAG dag, JobConf conf) {
    if (!UserGroupInformation.isSecurityEnabled()){
      return;
    }
    for (DagCredentialSupplier supplier : credentialSuppliers) {
      Text alias = supplier.getTokenAlias();
      Token<?> t = dag.getCredentials().getToken(alias);
      if (t != null) {
        continue;
      }
      LOG.debug("Attempt to get token {} for work {}", alias, work.getName());
      t = supplier.obtainToken(work, tables, conf);
      if (t != null) {
        dag.getCredentials().addToken(alias, t);
      }
    }
  }
Set up credentials for the base work on secure clusters
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java