httpntlm
httpntlm is a Node.js library to do HTTP NTLM authentication
It's a port from the Python libary python-ntml with added NTLMv2 support.
Snyk security scan
Donate
If you've benefited from this module in any way, please consider donating!
Donations:
| Name | amount | when |
|---|---|---|
| Tina Lacey | $ 20 | June 2018 |
Last update: March 2023
Thank you for your support!
Install
You can install httpntlm using the Node Package Manager (npm):
npm install httpntlm
How to use
var httpntlm = require('httpntlm');
httpntlm.get({
url: "https://someurl.com",
username: 'm
Options
url: {String} URL to connect. (Required)
username: {String} Username (optional, default: '')
password: {String} Password (optional, default: '')
workstation: {String} Name of workstation (optional, default: '')
domain: {String} Name of domain (optional, default: '')
auth_scheme: {String} Authentication scheme used in the Authorization and WWW-Authenticate headers, for servers that only advertise Negotiate but accept NTLM (optional, default: 'NTLM')
agent: {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
headers: {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: Connection, Authorization (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
lm_password {Buffer} encrypted lm password.(Required)
nt_password {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared agent, the handshakes can get mixed up and you will see 401 responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an
agent at all: every call then gets its own connection, or
- pass a dedicated
agent per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
// safe: no shared agent, every call authenticates over its own connection
urls.forEach(function (url) {
httpntlm.get({ url: url, username: 'm
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes
the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported
NTLM version cannot be negotiated).
Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
var httpntlm = require('httpntlm');
var ntlm = httpntlm.ntlm;
var lm = ntlm.create_LM_hashed_password('Azx123456');
var nt = ntlm.create_NT_hashed_password('Azx123456');
httpntlm.get({
url: "https://someurl.com",
username: 'm
Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
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
Download binary files
httpntlm.get({
url: "https://someurl.com/file.xls",
username: 'm
Pass in custom headers
httpntlm.get({
url: "http://localhost:3000",
username: 'm
More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
npm test
Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
,
password: 'stinks',
workstation: 'choose.something',
domain: ''
}, function (err, res){
if(err) return console.log(err);
console.log(res.headers);
console.log(res.body);
});
Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
__CODE_BLOCK_2__
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes
the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported
NTLM version cannot be negotiated).
Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__
Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__
Download binary files
__CODE_BLOCK_5__
Pass in custom headers
__CODE_BLOCK_6__
More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__
Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
, password: 'stinks' }, callback);
});
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes
the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported
NTLM version cannot be negotiated).
Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__
Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__
Download binary files
__CODE_BLOCK_5__
Pass in custom headers
__CODE_BLOCK_6__
More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__
Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
,
password: 'stinks',
workstation: 'choose.something',
domain: ''
}, function (err, res){
if(err) return console.log(err);
console.log(res.headers);
console.log(res.body);
});
Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
__CODE_BLOCK_2__
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes
the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported
NTLM version cannot be negotiated).
Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__
Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__
Download binary files
__CODE_BLOCK_5__
Pass in custom headers
__CODE_BLOCK_6__
More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__
Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
,
lm_password: lm,
nt_password: nt,
workstation: 'choose.something',
domain: ''
}, function (err, res){
if(err) return console.log(err);
console.log(res.headers);
console.log(res.body);
});
Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__
Download binary files
__CODE_BLOCK_5__
Pass in custom headers
__CODE_BLOCK_6__
More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__
Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
,
password: 'stinks',
workstation: 'choose.something',
domain: ''
}, function (err, res){
if(err) return console.log(err);
console.log(res.headers);
console.log(res.body);
});
Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
__CODE_BLOCK_2__
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes
the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported
NTLM version cannot be negotiated).
Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__
Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__
Download binary files
__CODE_BLOCK_5__
Pass in custom headers
__CODE_BLOCK_6__
More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__
Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
, password: 'stinks' }, callback);
});
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }; async.waterfall([ function (callback){ var type1msg = ntlm.createType1Message(options); 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')); var type2msg = ntlm.parseType2Message(res.headers['www-authenticate']); var type3msg = ntlm.createType3Message(type2msg, options); setImmediate(function() { 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); });Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, lm_password: lm, nt_password: nt, workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '', binary: true }, function (err, response) { if(err) return console.log(err); fs.writeFile("file.xls", response.body, function (err) { if(err) return console.log("error writing file"); console.log("file.xls saved!"); }); });Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, lm_password: lm, nt_password: nt, workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }; async.waterfall([ function (callback){ var type1msg = ntlm.createType1Message(options); 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')); var type2msg = ntlm.parseType2Message(res.headers['www-authenticate']); var type3msg = ntlm.createType3Message(type2msg, options); setImmediate(function() { 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); });Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, lm_password: lm, nt_password: nt, workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: 'somedomain', headers: { 'User-Agent': 'my-useragent' } }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, lm_password: lm, nt_password: nt, workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }; async.waterfall([ function (callback){ var type1msg = ntlm.createType1Message(options); 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')); var type2msg = ntlm.parseType2Message(res.headers['www-authenticate']); var type3msg = ntlm.createType3Message(type2msg, options); setImmediate(function() { 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); });Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, lm_password: lm, nt_password: nt, workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '', binary: true }, function (err, response) { if(err) return console.log(err); fs.writeFile("file.xls", response.body, function (err) { if(err) return console.log("error writing file"); console.log("file.xls saved!"); }); });Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, lm_password: lm, nt_password: nt, workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }; async.waterfall([ function (callback){ var type1msg = ntlm.createType1Message(options); 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')); var type2msg = ntlm.parseType2Message(res.headers['www-authenticate']); var type3msg = ntlm.createType3Message(type2msg, options); setImmediate(function() { 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); });Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, lm_password: lm, nt_password: nt, workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks' }, callback); });NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
, password: 'stinks', workstation: 'choose.something', domain: '' }, function (err, res){ if(err) return console.log(err); console.log(res.headers); console.log(res.body); });Options
- __INLINE_CODE_0__ {String} URL to connect. (Required)
- __INLINE_CODE_1__ {String} Username (optional, default: '')
- __INLINE_CODE_2__ {String} Password (optional, default: '')
- __INLINE_CODE_3__ {String} Name of workstation (optional, default: '')
- __INLINE_CODE_4__ {String} Name of domain (optional, default: '')
- __INLINE_CODE_5__ {String} Authentication scheme used in the __INLINE_CODE_6__ and __INLINE_CODE_7__ headers, for servers that only advertise __INLINE_CODE_8__ but accept NTLM (optional, default: 'NTLM')
- __INLINE_CODE_9__ {Agent} In case you want to reuse the keepaliveAgent over different calls (optional)
- __INLINE_CODE_10__ {Object} Add in custom headers. The following headers are used by NTLM and cannot be passed: __INLINE_CODE_11__, __INLINE_CODE_12__ (optional)
if you already got the encrypted password,you should use this two param to replace the 'password' param.
- __INLINE_CODE_13__ {Buffer} encrypted lm password.(Required)
- __INLINE_CODE_14__ {Buffer} encrypted nt password. (Required)
You can also pass along all other options of httpreq, including custom headers, cookies, body data, ... and use POST, PUT or DELETE instead of GET.
Concurrent requests
NTLM authenticates the TCP connection, not the individual request. The three steps of the handshake have to travel over the same connection, which is why httpntlm uses a keep-alive agent internally. If you fire several requests at the same time with a shared __INLINE_CODE_15__, the handshakes can get mixed up and you will see __INLINE_CODE_16__ responses or data from the wrong request.
To do concurrent requests, either:
- don't pass an __INLINE_CODE_17__ at all: every call then gets its own connection, or
- pass a dedicated __INLINE_CODE_18__ per concurrent request, or
- authenticate once and reuse the session cookies that the server hands out, if the server supports that.
NTLMv2
When NTLMv2 extended security and target information can be negotiated with the server, this library assumes the server supports NTLMv2 and creates responses according to the NTLMv2 specification (the actually supported NTLM version cannot be negotiated). Otherwise, NTLMv1 or NTLMv1 with NTLMv2 extended security will be used.
Advanced
pre-encrypt the password
__CODE_BLOCK_3__Use the NTLM-functions yourself
If you want to use the NTLM-functions yourself, you can access the ntlm-library like this (https example):
__CODE_BLOCK_4__Download binary files
__CODE_BLOCK_5__Pass in custom headers
__CODE_BLOCK_6__More examples
You can find more examples on Snyk.
More information
Tests
Running tests in an open source package is crucial for ensuring the quality and reliability of the codebase. When you submit code changes, it's essential to ensure that these changes don't break existing functionality or introduce new bugs.
Tests are written with Mocha.
To run tests, simply run:
__CODE_BLOCK_7__Note that the integration tests start up a simple express.js server with NTLM support. You might see some extra debugging info from that server when running integration tests.
License (MIT)
Copyright (c) Sam Decrock https://github.com/SamDecrock/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
