--- title: "How to handle NTLM authentication" slug: "how-to-handle-ntlm-authentication" updated: 2025-11-25T06:28:02Z published: 2025-11-25T06:28:02Z canonical: "helpcenter.autify.com/how-to-handle-ntlm-authentication" --- > ## Documentation Index > Fetch the complete documentation index at: https://helpcenter.autify.com/llms.txt > Use this file to discover all available pages before exploring further. # How to handle NTLM authentication This page explains how to handle testing on websites that use NTLM (New Technology LAN Manager) authentication. ## Configuration (Playwright Code Step) To handle NTLM authentication, add a Playwright code step to the beginning of your scenario to configure the automatic provision of credentials via the Chrome DevTools Protocol (CDP). Please add the following code as a Playwright code step: ```typescript const username = "username" const password = "password" const cdp = await context.newCDPSession(page) cdp.on("Fetch.requestPaused", ({ requestId }) =>  cdp.send("Fetch.continueRequest", { requestId }) ) cdp.on("Fetch.authRequired", ({ requestId }) => {  cdp.send("Fetch.continueWithAuth", {    requestId,    authChallengeResponse: {      response: "ProvideCredentials",      username,      password    }  }) }) await cdp.send("Fetch.enable", { handleAuthRequests: true }) ``` Please replace `username` and `password` on the first and second lines of the code with the actual username and password specified by the customer. ## Notes and Limitations > **If the username contains a backslash ()** (e.g., `DOMAIN\user`), it must be escaped in the code by writing `\\` (two backslashes). > > (Example: `const username = "DOMAIN\\user"` ) - **Credential Scope:** The username and password set in this code step will be automatically used for all NTLM authentication prompts that occur during this scenario execution.