Axios NTLM Authentication Helper

1.4.6 · active · verified Wed Apr 22

axios-ntlm is a helper library designed to integrate NTLM (NT LAN Manager) authentication into the popular Axios HTTP client, specifically for Node.js environments. It achieves this by attaching interceptors to an Axios instance, allowing seamless NTLM authentication for resources that require it. The current stable version is `1.4.6`. The package generally maintains a moderate release cadence, primarily focusing on dependency updates, bug fixes, and minor enhancements. Its key differentiator lies in its direct integration with Axios, providing a familiar API for developers already using Axios, and simplifying the often complex process of NTLM authentication in JavaScript applications interacting with Windows-authenticated services. It is particularly useful in enterprise settings where NTLM remains prevalent.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates how to create an NTLM-enabled Axios client using provided credentials and perform a simple GET request to a protected resource.

import { NtlmClient } from 'axios-ntlm';

(async () => {

    let credentials = {
        username: 'username',
        password: "password",
        domain: 'domain'
    };

    let client = NtlmClient(credentials);

    try {
        let resp = await client({
            url: 'https://protected.site.example.com',
            method: 'get'
        });
        console.log(resp.data);
    }
    catch (err) {
        console.log(err);
        console.log("Failed");
    }

})();

view raw JSON →