Skip to content
Discussion options

You must be logged in to vote

Got doesn't have built-in NTLM support. NTLM requires a multi-step challenge-response authentication process that doesn't fit well with Got's architecture.

Your best options are.

Use a dedicatd NTLM library like @node-ntlm/httpreq:

import {ntlm} from '@node-ntlm/httpreq';

const response = await ntlm({
	url: 'https://example.com/api',
	username: 'username',
	password: 'password',
	domain: 'DOMAIN' // Optional
});

console.log(response.body);

Use a local NTLM proxy:

Set up a proxy like CNTLM or Px to handle NTLM authentication locally, then use Got through the proxy:

import got from 'got';
import {HttpsProxyAgent} from 'hpagent';

await got('https://example.com/api', {
	agent: {
		https: new 

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@carlo-andreoli
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by sindresorhus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants