Send request using NTLM Authorization #2106
-
|
Hi, is there a way to use the package to send request using NTLM Authentication (username & password) Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Can you provide me with a link to the specification? |
Beta Was this translation helpful? Give feedback.
-
|
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 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 HttpsProxyAgent({
proxy: 'http://localhost:3128' // Your NTLM proxy
})
}
});The dedicated NTLM libraries are your best bet since they handle the complex authentication handshake that NTLM requiers. |
Beta Was this translation helpful? Give feedback.

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:Use a local NTLM proxy:
Set up a proxy like CNTLM or Px to handle NTLM authentication locally, then use Got through the proxy: