On the relevant CDP session, register handlers before navigation, then call Fetch.enable with these parameters:

{"handleAuthRequests": true}
EventRequired response path
Fetch.requestPausedcontinueRequest with that requestId when ordinary work should proceed
Fetch.authRequiredInspect authChallenge, then continueWithAuth using the authentication event's requestId

For the recognized intermediary, the auth parameters are:

{
  "requestId": "REQUEST_ID_FROM_AUTH_EVENT",
  "authChallengeResponse": {
    "response": "ProvideCredentials",
    "username": "PROXY_USERNAME",
    "password": "PROXY_PASSWORD"
  }
}

Check authChallenge.source is Proxy and its origin is the intended challenger before loading the account from the credential source. A Server challenge follows another authentication policy.

Track allowed attempts per intercepted request; a repeated rejected challenge should receive CancelAuth, not another endless submission. Clear tracking on completion/session closure.

If the page hangs, inspect unresolved requestPaused events too. Authentication handling does not continue them automatically, and neither event path selects the browser's proxy route.

Artihkkalat mat laktásit