How do I implement NTLM authentication using Puppeteer?
Clash Royale CLAN TAG#URR8PPP
How do I implement NTLM authentication using Puppeteer?
I would like to use Puppeteer to automate testing with a site that requires NTLM authentication. It appears the page.authenticate() API only accepts a username and password but no domain. Does anyone have any suggestions or tips?
1 Answer
1
Until now, the only way that worked for me was using cntlm:
const puppeteer = require('puppeteer');
async function run()
const browser = await puppeteer.launch(
args: [
"--proxy-server=localhost:3133" // the cntlm proxy defined in cntlm.conf
]
);
const page = await browser.newPage();
await page.goto('http://example.com');
await page.screenshot( path: 'screenshots/example.png' );
browser.close();
run();
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
thanks for the recommendation! I haven't yet been able to test out the use of cntlm but will update this post when I do...
– vadamo
Sep 11 at 13:25