Symptom
Connecting a cookie-auth custom integration whose login page delegates to Google SSO fails at the Google login step — Google returns an error (typically "Couldn't sign you in" / "This browser or app may not be secure") and capture never completes. Reproducible / appears to always fail.
Root cause
The cookie-capture flow spawns Chromium in headless mode with Playwright's bundled binary:
packages/server/src/auth/cookie.ts:130-148
"--headless=new",
`--remote-debugging-port=${remotePort}`,
`--user-data-dir=${userDataDir}`,
"--remote-allow-origins=http://127.0.0.1",
"--no-first-run",
"--no-default-browser-check",
"--disable-features=TranslateUI",
"--window-size=1280,800",
loginUrl,
Google's account sign-in actively blocks headless and automation-controlled browsers (policy against "embedded/automated user-agents"). Signals that trip it here:
--headless=new → default UA contains HeadlessChrome.
- Playwright/CDP-driven Chromium →
navigator.webdriver = true, automation fingerprints.
- No
--disable-blink-features=AutomationControlled, no UA override.
So even though the user drives the login through the portal screencast, Google sees a headless automated browser and refuses. This blocks every cookie integration gated behind Google SSO.
Options (in rough order of robustness)
- Headed Chromium under a virtual display (Xvfb) instead of
--headless=new. Real headed Chrome is far less likely to be flagged. Image already has the chromium + libs; add xvfb and run with DISPLAY.
- Reduce automation fingerprint: override UA to drop
HeadlessChrome, add --disable-blink-features=AutomationControlled. Helps but Google may still detect navigator.webdriver / CDP — partial.
- Document the limitation: if neither lands, state clearly that Google-SSO-gated sites can't be cookie-captured; steer such integrations to a proper OAuth2 plugin instead.
Note: Google deliberately fights automated login; expect an arms race. Option 1 (Xvfb headed) is the most durable.
Acceptance
Source
packages/server/src/auth/cookie.ts:128-149 (chromium spawn args)
Symptom
Connecting a cookie-auth custom integration whose login page delegates to Google SSO fails at the Google login step — Google returns an error (typically "Couldn't sign you in" / "This browser or app may not be secure") and capture never completes. Reproducible / appears to always fail.
Root cause
The cookie-capture flow spawns Chromium in headless mode with Playwright's bundled binary:
packages/server/src/auth/cookie.ts:130-148Google's account sign-in actively blocks headless and automation-controlled browsers (policy against "embedded/automated user-agents"). Signals that trip it here:
--headless=new→ default UA containsHeadlessChrome.navigator.webdriver = true, automation fingerprints.--disable-blink-features=AutomationControlled, no UA override.So even though the user drives the login through the portal screencast, Google sees a headless automated browser and refuses. This blocks every cookie integration gated behind Google SSO.
Options (in rough order of robustness)
--headless=new. Real headed Chrome is far less likely to be flagged. Image already has the chromium + libs; addxvfband run withDISPLAY.HeadlessChrome, add--disable-blink-features=AutomationControlled. Helps but Google may still detectnavigator.webdriver/ CDP — partial.Note: Google deliberately fights automated login; expect an arms race. Option 1 (Xvfb headed) is the most durable.
Acceptance
connect()/ the connect page surfaces a clear "Google SSO login not supported for cookie auth — use OAuth" message instead of a generic Google error.docs/findings/.Source
packages/server/src/auth/cookie.ts:128-149(chromium spawn args)