Skip to content

SSO (#9077): Google federated login #13412

Done

Description

@dezren39

Refs #9077. Design: doc/2026-11-23_design_fleet_sso_9077.md §3.

Scope: Google OIDC as upstream federated door; links to the same account row; test: Drew's Google signs in against the allowlisted account.

Acceptance: login via this door reaches the same account as the other doors; non-allowlisted attempts denied with audit; depends on the provider stand-up issue (#13409).

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T15:36:36Z",
    "session_id": "ses_e5df703b424ffeYiDdwritlbyD",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/code-wt-sso-9077",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/code-wt-sso-9077",
      "repo": "developing-today/code",
      "branch": "lane/oc-code-05/sso-9077-design",
      "sha": "4204df0de25ea49e728773ded1f059cefbed56be"
    },
    "auth_subject": "oc-code-02",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Activity

  1. added
    kind/feature
    epic/pm-stack
    on Nov 23, 2026
  2. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Premise check + build note (IDP-BUILD-4, 2026-11-23)

    #13409 closed today with its acceptance verified first-hand, so this door's dependency is met. Two facts shape the slice, recorded before building:

    1. No Google OAuth client for the provider door exists yet. The vault's google.access-sso.client-id/-secret belong to Cloudflare Access (their registered redirect is the Access callback); the provider door needs its own OAuth client — or that client extended — with redirect URI <issuer>/door/google/callback, a signed-in Google Cloud console step. The live "Drew's Google signs in" test therefore cannot run until that registration exists: client id into the on-host provider config, client secret into the vault as idp.google.client-secret (launcher exports IDP_GOOGLE_CLIENT_SECRET). Drew's allowlisted Google identity is the sub claim (google:<sub>).
    2. What is built and proven now is the complete door machinery in pkgs/idp-provider: upstream authorize redirect (OIDC + PKCE, nonce) with server-side pending-request state, callback code exchange, upstream ID-token verification against Google's JWKS (iss/aud/exp/nonce checked), the deny-by-default allowlist gate enforced in the provider, linking to the same account row (SSO (#9077): account linking UI/flow with retained identity history #13415), and audit of every attempt. It is proven end-to-end against a mock Google-shaped OIDC upstream over real HTTP — a login via this door mints tokens for the same account sub as the local door — plus the crate's flow tests.

    This issue stays open on the live-registration proof (fact 1); the machinery lands under this lane and is recorded here when merged.

  4. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Door machinery — LANDED (IDP-BUILD-4, 2026-11-23)

    PR #13782 merged to main as 8e61b2c7a58e005ca8567be3886b3d0f99d89505. The full door now exists in pkgs/idp-provider (src/doors.rs + src/upstream.rs): start re-validates the RP request and parks it under a single-use state handle; the callback exchanges the upstream code, verifies the upstream identity, enforces the deny-by-default allowlist in the provider, links per #13415, and mints our own code — a login via this door produces tokens for the same account sub with the same #1253 role claims as the local door.

    Proof (laptop): tests/doors.rs drives this door's exact flow over real HTTP against a mock upstream — full loop to the same account, non-allowlisted identity denied + audited with no link created, state-handle replay denied. Full crate suite: 15/15 pass.

    Remaining for acceptance: the live sign-in, which needs the upstream app registration recorded in the premise note above (client id into the on-host config, secret into the vault under the recorded name). This issue stays open for that step.

  5. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Door LIVE-PROVEN — acceptance met (IDP-DOORS-REGISTER, 2026-11-23)

    The Google door is registered, configured, and proven end to end against the live provider (issuer http://127.0.0.1:8911):

    • Registration: new OAuth client (Web application) in Google Cloud project gen-lang-client-0842056359, client ID 709345419199-lqeuhpkaesudt5jn1ut6mtf6k0umg9gi.apps.googleusercontent.com, authorized redirect URI http://127.0.0.1:8911/door/google/callback (the recipe's <issuer>/door/google/callback). Note: Google no longer lets you view a client's original secret after creation, so a fresh secret was added and captured in-page on the laptop.
    • Vault: the secret is stored by name as idp.google.client-secret (byte-verified in-process at capture; never printed or copied off the laptop). The provider config names IDP_GOOGLE_CLIENT_SECRET; the on-host launcher (~/idp-provider/start-provider.sh) fills it from the vault by name, same pattern as the CA passphrase.
    • Allowlist discovery, as designed: the first live attempt was denied not_allowlisted and audited, revealing Drew's Google identity key google:114042261698526544687; that key was added to the provider allowlist and the provider restarted.
    • Live sign-in proof (test RP, PKCE S256): door start → Google account chooser → consent → callback → code → /token 200 → ID token with sub=drew (the same account as the local door), full design(pm-stack): one identity across the stack — SSO propagation from the public entry into every layer, roles replace asserted authorship #1253 role set (owner, orchestrator, agent, read-only), nonce + state verified → /userinfo 200 with the same sub and roles.
    • Audit trail: door/google challenge/upstream_redirect → denied/not_allowlisted (first pass) → link allowed + door/google allowed/code_issued + token allowed/tokens_issued (second pass). Identity store shows google:114042261698526544687 account=drew status=active — linked by the door login itself, per SSO (#9077): account linking UI/flow with retained identity history #13415.

    Acceptance is met in full: login via this door reaches the same account as the other doors, and the non-allowlisted attempt was denied with audit. Closing.

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

    epic/pm-stackkind/featurestatus:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions