{
  "slug": "browser-newcontext-accepts-multiple-http-credentials-0f0e3457b501",
  "title": "Browser.newContext() accepts multiple HTTP credentials",
  "tools": [
    "playwright"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-09-04T22:40:31.000Z",
  "announced_at": "2026-09-04T22:40:31.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When browser tests need different HTTP credentials by request origin, pass an array of credential objects to `browser.newContext({ httpCredentials })`. The first entry matching the request origin is used; an entry without `origin` matches any request.",
    "examples": [
      "const context = await browser.newContext({\n  httpCredentials: [\n    { username: \"<user-1>\", password: \"<password-1>\", origin: \"https://<host-1>:<port>\" },\n    { username: \"<user-2>\", password: \"<password-2>\", origin: \"https://<host-2>:<port>\" },\n  ],\n});"
    ],
    "gotchas": [
      "Version: v1.63.0",
      "httpCredentials: An object or array of objects containing HTTP authentication credentials. For an array, the first entry matching the request origin is used; an entry without `origin` matches any request.",
      "httpCredentials[].username (required): Username for HTTP authentication.",
      "httpCredentials[].password (required): Password for HTTP authentication.",
      "httpCredentials[].origin: Restricts sending credentials to the specified origin (`scheme://host:port`).",
      "httpCredentials[].send: For corresponding APIRequestContext requests, `always` sends credentials on each API request; `unauthorized` sends them after a 401 with `WWW-Authenticate`. Defaults to `unauthorized`.",
      "The first entry matching the request origin is used; entries without an origin match any request."
    ]
  },
  "why_it_matters": "Run browser tests against an application using different HTTP credentials for different request origins.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.63.0",
    "https://playwright.dev/docs/api/class-browser"
  ],
  "rank": 0.95029,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "augsep-20261008",
    "verdict_id": "augsep-20261008:augsep-20261008-579bf8375159b0fd-5:gate",
    "evidence_hash": "8f458d0a9fe7d706ecdbbba7433f7d4b9f5359e0c90f3581627b8ce9e8b79bc6"
  },
  "review": {
    "draft_hash": "54808cb79bc51d25ad77f234318a03622d999812748f8ff14a28439a03afd70f",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "augsep-20261008:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.95 >= 0.9; 2 needed) and Jev gave 0.72 (>= 0.6 needed)."
  }
}
