private <Intermediate, Final> void innerGo(final Request request,
      final HttpResponseHandler<Intermediate, Final> httpResponseHandler,
      final Duration duration,
      final SettableFuture<Final> future) {
    try {
      final String host = request.getUrl().getHost();
      final URI uri = request.getUrl().toURI();

      /* Cookies Manager is used to cache cookie returned by service.
       The goal us to avoid doing KDC requests for every request.*/

      Map<String, List<String>> cookieMap = cookieManager.get(uri, Collections.emptyMap());
      for (Map.Entry<String, List<String>> entry : cookieMap.entrySet()) {
        request.addHeaderValues(entry.getKey(), entry.getValue());
      }
      final boolean shouldRetryOnUnauthorizedResponse;

      if (DruidKerberosUtil.needToSendCredentials(cookieManager.getCookieStore(), uri)) {
        // No Cookies for requested URI, authenticate user and add authentication header
        LOG.debug("No Auth Cookie found for URI{}. Existing Cookies{} Authenticating... ",
            uri,
            cookieManager.getCookieStore().getCookies());
        // Assuming that a valid UGI with kerberos cred is created by HS2 or LLAP
        UserGroupInformation currentUser = UserGroupInformation.getCurrentUser();
        currentUser.checkTGTAndReloginFromKeytab();
        LOG.debug("The user credential is {}", currentUser);
        String
            challenge =
            currentUser.doAs((PrivilegedExceptionAction<String>) () -> DruidKerberosUtil.kerberosChallenge(host));
        request.setHeader(HttpHeaders.Names.AUTHORIZATION, "Negotiate " + challenge);
        /* no reason to retry if the challenge ticket is not valid. */
        shouldRetryOnUnauthorizedResponse = false;
      } else {
        /* In this branch we had already a cookie that did expire
        therefore we need to resend a valid Kerberos challenge*/
        LOG.debug("Found Auth Cookie found for URI {} cookie {}",
            uri,
            DruidKerberosUtil.getAuthCookie(cookieManager.getCookieStore(), uri).toString());
        shouldRetryOnUnauthorizedResponse = true;
      }

      @SuppressWarnings("unchecked") ListenableFuture<RetryResponseHolder<Final>>
          internalFuture =
          delegate.go(request,
              new RetryIfUnauthorizedResponseHandler<Intermediate, Final>(new ResponseCookieHandler(request.getUrl()
                  .toURI(), cookieManager, httpResponseHandler)),
              duration);

      RetryResponseHolder<Final> responseHolder = internalFuture.get();

      if (shouldRetryOnUnauthorizedResponse && responseHolder.shouldRetry()) {
        LOG.debug("Preparing for Retry boolean {} and result {}, object{} ", true,
            responseHolder.shouldRetry(),
            responseHolder.getObj());
        // remove Auth cookie
        DruidKerberosUtil.removeAuthCookie(cookieManager.getCookieStore(), uri);
        // clear existing cookie
        request.setHeader("Cookie", "");
        innerGo(request.copy(), httpResponseHandler, duration, future);

      } else {
        future.set(responseHolder.getObj());
      }
    } catch (Throwable e) {
      throw Throwables.propagate(e);
    }
  }
This is a slightly modified version of kerberos module borrowed from druid project
Couple of reasons behind the copy/modification instead of mvn dependency.
 1/ Need to remove the authentication step since it not required
 2/ To avoid some un-needed transitive dependencies that can clash on the classpath like jetty-XX.
druid-handler/src/java/org/apache/hadoop/hive/druid/security/KerberosHttpClient.java