 
 (def ^Base64 base64 (Base64.))
 
-(defn spnego-authentication
-  "Returns an Authentication$Result for endpoint which will use SPNEGO to generate an Authorization header"
-  [^URI endpoint]
+(defn create-spnego-authentication-result-factory
+  "Returns an Authentication$Result for an endpoint which will use SPNEGO to generate the header value for the
+  provided authorization header field."
+  [^URI endpoint auth-header-field]
   (reify Authentication$Result
     (getURI [_] endpoint)
 

  (:import (java.net URI)
           (java.util ArrayList)
           (org.apache.commons.codec.binary Base64)
           (org.eclipse.jetty.client HttpClient WWWAuthenticationProtocolHandler)
           (org.eclipse.jetty.client.api Authentication$Result Request)
           (org.eclipse.jetty.http HttpField HttpHeader)
           (org.eclipse.jetty.http2.client HTTP2Client)


(defn ^HttpClient http-client-factory
  "Creates a HttpClient."
  [{:keys [clear-content-decoders conn-timeout proxy-url proxy-spnego-auth socket-timeout user-agent]
    :or {clear-content-decoders true}
    :as config}]
  (let [^HttpClient client
