Skip to content
Permalink
Browse files

Set NTLM authentication at the client build level instead of context

Relates to #409
  • Loading branch information
dakrone committed Apr 19, 2018
1 parent 36d8c3f commit d2914602c77c48db02dbf56e82972ec60cc1c32c
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/clj_http/core.clj
@@ -306,7 +306,7 @@
[{:keys [retry-handler request-interceptor
response-interceptor proxy-host proxy-port
http-builder-fns cookie-spec
cookie-policy-registry]
cookie-policy-registry ntlm-auth]
:as req}
caching?
conn-mgr
@@ -326,6 +326,12 @@
(get-route-planner
proxy-host proxy-port
proxy-ignore-hosts http-url)))]
(when-let [[user password host domain] ntlm-auth]
(.setDefaultCredentialsProvider
builder
(doto (BasicCredentialsProvider.)
(.setCredentials AuthScope/ANY
(NTCredentials. user password host domain)))))
(when cache?
(.setCacheConfig builder (build-cache-config req)))
(when (or cookie-policy-registry cookie-spec)
@@ -588,12 +594,6 @@
(doto (credentials-provider)
(.setCredentials (AuthScope. nil -1 nil)
(UsernamePasswordCredentials. user pass)))))
(when-let [[user password host domain] ntlm-auth]
(.setCredentialsProvider
context
(doto (credentials-provider)
(.setCredentials (AuthScope. nil -1 nil)
(NTCredentials. user password host domain)))))
(when (and proxy-user proxy-pass)
(let [authscope (AuthScope. proxy-host proxy-port)
creds (UsernamePasswordCredentials. proxy-user proxy-pass)]

0 comments on commit d291460

Please sign in to comment.
You can’t perform that action at this time.