set_session_auth
Inject captured browser credentials into Playwright for authentication flows like Google OAuth, enabling automated testing of restricted login pages.
Instructions
Inject user-browser credentials into Playwright (restricted auth). ALWAYS saves profileId; optional sessionId applies to a live session.
BEFORE calling this tool: you MUST already have sent the user (same conversation) the login URL + Network Cookie steps + JS snippet from server instructions. Never call this tool "speculatively" without first giving those instructions. Never open headed login for Google OAuth — use this flow.
Triggers: Google OAuth / Sign in with Google, Gmail/Google apps, Microsoft/Entra, Apple, Discord OAuth, Cloudflare Turnstile on login, Okta/Auth0 social IdP, or any login Playwright cannot complete.
Accepts credentialsJson from the console snippet (Cookie header + storage) or Playwright storageState JSON.
Example (after user pastes):
{
"siteUrl": "https://mail.google.com/",
"credentialsJson": "{...paste from user...}"
}Returns: { "ok": true, "profileId": "prof_…", "strategy": "restricted_auth" }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| authUrl | No | Optional auth URL for profile meta (defaults to siteUrl) | |
| siteUrl | Yes | Target application URL (inject / navigate origin) | |
| sessionId | No | If set, also inject credentials into this live session | |
| credentialsJson | Yes | JSON paste from the restricted-auth console snippet (Network Cookie header + storage) or Playwright storageState. Only call set_session_auth after the user was given the login URL + snippet and has pasted this JSON. |