Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NTLM authentication using node.js

Tags:

node.js

ntlm

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.

like image 427
user1514989 Avatar asked Aug 27 '12 10:08

user1514989


3 Answers

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.

like image 173
Sam Avatar answered Sep 21 '22 03:09

Sam


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

like image 28
Kinetic Avatar answered Sep 18 '22 03:09

Kinetic


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
like image 31
molefrog Avatar answered Sep 21 '22 03:09

molefrog