Registry / http-networking / axios-ntlm

axios-ntlm

JSON →
library1.4.6jsnpmunverified

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.

npm install axios-ntlm
INSTALL
IMPORT
SIG · AXIOS-NTLM
A
axios-ntlm
http-networkingjavascriptv1.4.6
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NtlmClient
import { NtlmClient } from 'axios-ntlm';
const NtlmClient = require('axios-ntlm').NtlmClient;
This is the primary factory function for creating Axios instances configured with NTLM authentication.
NtlmCredentials
import { NtlmCredentials } from 'axios-ntlm';
import NtlmCredentials from 'axios-ntlm';
This is a TypeScript interface defining the structure for NTLM authentication credentials (username, password, domain).
AxiosRequestConfig
import { AxiosRequestConfig } from 'axios';
import { AxiosRequestConfig } from 'axios-ntlm';
While used extensively with `axios-ntlm`, `AxiosRequestConfig` is exported directly from the `axios` package, not `axios-ntlm`.

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"); } })();
Debug
Known issues
breakingA critical security vulnerability (CVE-2022-0155) related to an underlying dependency was patched in version `1.2.2`.
fix
Immediately upgrade to `axios-ntlm@1.2.2` or later to mitigate potential security risks and ensure application security.
affects: <1.2.2
breakingPrior to `v1.4.1`, requests involving an `X-retry: false` header could inadvertently enter an infinite retry loop, leading to resource exhaustion or indefinite hangs.
fix
Upgrade to `axios-ntlm@1.4.1` or later to resolve the infinite retry bug. If using an older version, avoid sending `X-retry: false` headers.
affects: <1.4.1
gotchaWhen providing a custom `AxiosRequestConfig` to `NtlmClient`, explicitly configure `httpAgent` and `httpsAgent` for connection pooling and keep-alive if you are overriding the default agents. The library will add agents if none are present, but your custom configuration might override this.
fix
Ensure your custom `AxiosRequestConfig` correctly sets `httpAgent` and `httpsAgent` with `keepAlive: true` for optimal performance with NTLM authenticated endpoints.
affects: >=1.0.0
Errors
Common errors & fixes
Request hangs indefinitely with no response or error.
In versions prior to `1.4.1`, setting an `X-retry` header to `false` could trigger an infinite retry loop, causing requests to never complete and your application to appear unresponsive.
fix
Upgrade your `axios-ntlm` package to version `1.4.1` or higher. If an upgrade is not immediately possible, avoid sending `X-retry: false` headers when making requests.
Upgrade
Version history
1.4.6latest on npm
Audit
Dependencies
axiosrequiredCore HTTP client dependency; `axios-ntlm` extends its functionality via interceptors.
des.jsrequiredCryptography library used for NTLM hash generation, introduced as a replacement in v1.4.0.
Agent activity
36 hits · last 30 days
node
32
OpenAI (training)
1
Resources
axios-ntlm — npm install axios-ntlm · libregistry