Skip to content

Cookie-auth capture fails for sites using Google SSO (headless chromium blocked by Google) #17

Description

@barockok

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)

  1. 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.
  2. Reduce automation fingerprint: override UA to drop HeadlessChrome, add --disable-blink-features=AutomationControlled. Helps but Google may still detect navigator.webdriver / CDP — partial.
  3. 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

  • A cookie integration whose login uses Google SSO can complete capture end-to-end, OR
  • If unsupported, connect() / the connect page surfaces a clear "Google SSO login not supported for cookie auth — use OAuth" message instead of a generic Google error.
  • Decision + approach recorded in docs/findings/.

Source

packages/server/src/auth/cookie.ts:128-149 (chromium spawn args)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions