12

I need to use node.js to communicate with a server using NTLM proxy authentication.

I have used 2 modules:

  1. node-curl https://github.com/jiangmiao/node-curl
  2. request, coming highly recommended htps://github.com/mikeal/request

I found no documentation for the request module for ntlm , and though node-curl supports the curl easy options , I found no documentation about how to specify the CURLAUTH_NTLM for the CURLOPT_HTTPAUTH.

I want to know how to take care of the NTLM proxy authentication. I would love to continue using the request module.

1
  • 1
    Also see this question. I don't think there is any support for NTLM in request or any node modules, so your best bet seems to be to spawn a curl --proxy-ntlm process. Commented Aug 27, 2012 at 14:39

5 Answers 5

9

Wrote a Node.js library to do the HTTP NTLM Handshaking: https://github.com/SamDecrock/node-http-ntlm

It's ported from the python-ntlm library.

Sign up to request clarification or add additional context in comments.

Comments

3

If you are using Express you can use express-ntlm it makes NTLM a lot less frustrating overall

https://www.npmjs.com/package/express-ntlm

Comments

2

Is it important for you to use NTLM directly in node.js code?

Instead you can try to install some intermediate NTLM proxies that will give you a chance to use simple HTTP proxy in node.js. There are at least two solutions for it:

  1. Cntlm - written in C
  2. Ntlmaps - written in Python

Comments

-1

Here is a partial implementation of the server side of NTLM in Node.js. It may help with developing a client side request: https://gist.github.com/3049352

And here is some code which appears to generate the type 1 message and recieve the type 2 response. The type 3 message is not yet implemented and is the final step: github.com/kevinswiber/node-ntlm-client

Here is some documentation on the NTLM protocol that should help complete it: http://www.innovation.ch/personal/ronald/ntlm.html

It's a start.

1 Comment

That's really not an example of the server side of NTLM. As the gist mentions, it's completely fake.
-1

Unfortunately I've only made more or less simplistic versions of NTLM.

This is a bit more complete: https://gist.github.com/Piot/3063016

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.