dakrone / dakrone/clj-http

NTLM Auth doesn't work

Open
#409 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug waiting for user
Dominant language
Clojure
Stars
1.8k
Forks
410
PR merge metrics
No merged PRs in 30d

Description

Hello, ntlm auth doesn't work:

(def login "login")
(def pass "pass")
(def host "localhost")
(def domain "domain")

;; Works and returns status 200.
(let [nt (NTCredentials. login pass host domain)
      creds (doto (BasicCredentialsProvider.) (.setCredentials AuthScope/ANY nt))
      client (-> (HttpClients/custom) (.setDefaultCredentialsProvider creds) (.build))
      request (HttpGet. "https://foo.com")
      response (.execute client request)]
  (.getStatusLine response))

;; Doesn't and return status 401
(client/get "https://foo.com" {:ntlm-auth [login pass host domain]})

Curious about why it doesn't work, since code in core.clj is similar to the working version above.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading core.clj and comparing its NTLM credential setup with the working Apache HttpClient example in the issue. Reproduce both requests and inspect why the client library path returns HTTP 401 while the direct client returns 200; done means the :ntlm-auth request succeeds against the reported endpoint.

Written by the indexing model from the issue text.

Assessment

Tech stack
apache, clojure
Domain
authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.