docs: public static void initCredentials(Job job) {
          Configuration configuration = job.getConfiguration();
          Settings settings = HadoopSettingsManager.loadFrom(configuration);
          InitializationUtils.setUserProviderIfNotSet(settings, HadoopUserProvider.class, LOG);
          UserProvider userProvider = UserProvider.create(settings);
  
          if (userProvider.isEsKerberosEnabled()) {
              User user = userProvider.getUser();
              ClusterInfo clusterInfo = settings.getClusterInfoOrNull();
              RestClient bootstrap = new RestClient(settings);
              try {
                  // first get ES main action info if it's missing
                  if (clusterInfo == null) {
                      clusterInfo = bootstrap.mainInfo();
                  }
                  // Add the token to the job
                  TokenUtil.addTokenForJob(bootstrap, clusterInfo.getClusterName(), user, job);
              } catch (EsHadoopException ex) {
                  throw new EsHadoopIllegalArgumentException(String.format("Cannot detect ES version - "
                          + "typically this happens if the network/Elasticsearch cluster is not accessible or when targeting "
                          + "a WAN/Cloud instance without the proper setting '%s'", ConfigurationOptions.ES_NODES_WAN_ONLY), ex);
              } finally {
                  bootstrap.close();
              }
          } else {
              if (LOG.isDebugEnabled()) {
                  LOG.debug("Ignoring Elasticsearch credentials since Kerberos Auth is not enabled.");
              }
          }
      }