packages/builtin-skills/src/acceptance/references/auth-web.md
Use this reference only when the Web criterion is behind a login gate.
Authenticate the same named agent-browser session that will capture evidence;
a screenshot from a different browser does not prove the automated session
reached the state.
This workflow is provider-neutral. Discover the target's actual endpoint, cookie domain, and session mechanism before selecting a path.
agent-browser get url did not return
the sign-in route before capturing evidence.# Named session: persists cookies and localStorage.
agent-browser --session app open https://app.example.com/login
# Complete login once, then reuse the same session.
agent-browser --session app open https://app.example.com/dashboard
# Playwright-style storage state.
agent-browser state save auth.json
agent-browser state load auth.json
# Encrypted credential vault and form replay.
echo "$PASSWORD" | agent-browser auth save app \
--url https://app.example.com/login --username user --password-stdin
agent-browser auth login app
# Dedicated persistent browser profile.
agent-browser --profile ~/.app-profile open https://app.example.com/login
If the app exposes a sign-in API, POST credentials, capture the returned cookies, convert them to a storage-state file, and load that state into the evidence session. Endpoint shape, field names, and cookie names are app-specific; inspect them rather than assuming.
Cookie: request header. Do not use document.cookie;
HttpOnly session cookies are invisible there.localhost is not 127.0.0.1; local domains need no leading dot).| Symptom | Cause | Fix |
|---|---|---|
| Redirects after injection | document.cookie omitted the HttpOnly session | Copy the Network request's cookie header |
| "no cookies found" | The copied value is not the raw request cookie header | Preserve the header value verbatim |
| Works briefly, then expires | The session rotated or expired | Acquire and inject a fresh dev session |
| Works on one host spelling | Cookie domain and target host differ | Use the literal target host |
Return to the selected Web flow after the authenticated session passes its protected-route check.