Socket
Socket
Sign inDemoInstall

ntlm-ad-client

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ntlm-ad-client

A simple NTLM client for Active Directories


Version published
Weekly downloads
0
Maintainers
1
Install size
21.0 kB
Created
Weekly downloads
 

Readme

Source

NPM version

ntlm-ad-client

A simple NTLM Client to negotiate and authenticate against an Active Directory.

ntlm-ad-client is heavily inspired by PyAuthenNTLM2. Also a thanks to Alessandro Mancini for separating and refactoring the main part of this module from its originating repository express-ntlm

install

$ npm install ntlm-ad-client

example usage

const ntlm_client = require('ntlm-ad-client')

const MESSAGE_NTLM_1 = 'MESSAGE_NTLM_1';
const MESSAGE_NTLM_3 = 'MESSAGE_NTLM_3'
const HOSTNAME = 'YOUR_HOSTNAME'
const PORT = 'YOUR_PORT'
const DOMAIN = 'YOUR_DOMAIN'

const client = ntlm_client({
    hostname: HOSTNAME,
    port: PORT,
    domain: DOMAIN,
    path: null,
    use_tls: false,
    tls_options: undefined
})

client.negotiate(MESSAGE_NTLM_1, (err, challenge) => {
    if (err) throw new Error(err);
    console.log(challenge);

    client.authenticate(MESSAGE_NTLM_3, (err, result) => {
	if (err) throw new Error(err);
	console.log(result); // // {"DomainName":"MYDOMAIN","UserName":"MYUSER","Workstation":"MYWORKSTATION"}
    })
})

options

Nametypedescription
hostnamestringHostname of the Active Directory.
portstringPort of the Active Directory.
domainstringDefault domain if the DomainName-field cannot be parsed.
pathstringBase DN. not implemented yet
use_tlsbooleanIndicates wether to use TLS or not.
tls_optionsobjectAn options object that will be passed to tls.connect and tls.createSecureContext. Only required when using ldaps and the server's certificate is signed by a certificate authority not in Node's default list of CAs. (or use NODE_EXTRA_CA_CERTS environment variable)
tls_options.castring / array / BufferOverride the trusted CA certificates provided by Node. Refer to tls.createSecureContext

Keywords

FAQs

Last updated on 18 Jul 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc