Socket
Socket
Sign inDemoInstall

httpntlm

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

httpntlm - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

2

package.json
{
"name": "httpntlm",
"description": "httpntlm is a Node.js library to do HTTP NTLM authentication",
"version": "1.0.2",
"version": "1.1.0",
"dependencies": {

@@ -6,0 +6,0 @@ "httpreq": "~0.3.4",

@@ -38,51 +38,53 @@ # httpntlm

var ntlm = require('httpntlm').ntlm;
var async = require('async');
var httpreq = require('httpreq');
var HttpsAgent = require('agentkeepalive').HttpsAgent;
var keepaliveAgent = new HttpsAgent();
```js
var ntlm = require('httpntlm').ntlm;
var async = require('async');
var httpreq = require('httpreq');
var HttpsAgent = require('agentkeepalive').HttpsAgent;
var keepaliveAgent = new HttpsAgent();
var options = {
url: "https://someurl.com",
username: 'm$',
password: 'stinks',
workstation: 'choose.something',
domain: ''
};
var options = {
url: "https://someurl.com",
username: 'm$',
password: 'stinks',
workstation: 'choose.something',
domain: ''
};
async.waterfall([
function (callback){
var type1msg = ntlm.createType1Message(options);
async.waterfall([
function (callback){
var type1msg = ntlm.createType1Message(options);
httpreq.get(options.url, {
headers:{
'Connection' : 'keep-alive',
'Authorization': type1msg
},
agent: keepaliveAgent
}, callback);
},
httpreq.get(options.url, {
headers:{
'Connection' : 'keep-alive',
'Authorization': type1msg
},
agent: keepaliveAgent
}, callback);
},
function (res, callback){
if(!res.headers['www-authenticate'])
return callback(new Error('www-authenticate not found on response of second request'));
function (res, callback){
if(!res.headers['www-authenticate'])
return callback(new Error('www-authenticate not found on response of second request'));
var type2msg = ntlm.parseType2Message(res.headers['www-authenticate']);
var type3msg = ntlm.createType3Message(type2msg, options);
var type2msg = ntlm.parseType2Message(res.headers['www-authenticate']);
var type3msg = ntlm.createType3Message(type2msg, options);
httpreq.get(options.url, {
headers:{
'Connection' : 'Close',
'Authorization': type3msg
},
allowRedirects: false,
agent: keepaliveAgent
}, callback);
}
], function (err, res) {
if(err) return console.log(err);
httpreq.get(options.url, {
headers:{
'Connection' : 'Close',
'Authorization': type3msg
},
allowRedirects: false,
agent: keepaliveAgent
}, callback);
}
], function (err, res) {
if(err) return console.log(err);
console.log(res.headers);
console.log(res.body);
});
console.log(res.headers);
console.log(res.body);
});
```
## More information

@@ -89,0 +91,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc