(require 'cl)
(require 'ntlm)
+\f
+;;; Private variables.
(defvar url-http-ntlm--auth-storage nil
"Authentication storage.
An alist that maps a server name to a pair of \(<username> <ntlm
This is used to detect multiple calls.")
(make-variable-buffer-local 'url-http-ntlm--last-args)
+\f
+;;; Private functions.
(defun url-http-ntlm--ensure-keepalive ()
"Report an error if `url-http-attempt-keepalives' is not set."
(assert url-http-attempt-keepalives
"Return DATA encoded as an NTLM string."
(concat "NTLM " (base64-encode-string data :nobreak)))
+\f
+;;; Public function called by `url-get-authentication'.
(defun url-ntlm-auth (url &optional prompt overwrite realm args)
"Return an NTLM HTTP authorization header.
Get the contents of the Authorization header for a HTTP response
(:error
(url-http-ntlm--authorisation url :clear)))))
+\f
+;;; Register `url-ntlm-auth' HTTP authentication method.
(url-register-auth-scheme "ntlm" nil 8)
(provide 'url-http-ntlm)