code: private static Token<EsTokenIdentifier> getAuthToken(ClusterName clusterName, User user) {
          EsToken esToken = getEsAuthToken(clusterName, user);
          if (esToken == null) {
              return null;
          } else {
              return EsTokenIdentifier.createTokenFrom(esToken);
          }
      }
docs: Get the authentication token of the user for the provided cluster name in its Hadoop Token form.
  @return null if the user does not have the token, otherwise the auth token for the cluster.