How do I implement NTLM authentication using Puppeteer?

The name of the pictureThe name of the pictureThe name of the pictureClash 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();





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






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.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard