Skip to content

Google OAuth client, secrets and the prod public origin #1397

Backlog

Description

@athvin

Why

Google sign-in needs a registered OAuth client before any code can be tested against Google. Registering it takes human lead time: consent-screen branding has to be reviewed. Start this first.

There is also a second gap. Production never sets ERWEB_PUBLIC_BASE_URL, because deployment-web-api.yaml:183 only sets it when ingress is enabled, and prod has no ingress. An OIDC redirect URI has to match exactly, so the app needs to know its own absolute origin.

What the user sees

Nothing yet. This ticket is the plumbing everything else in the epic depends on.

How

  1. Owner (human step): create the Google Cloud project.

    • Create a project named "DupeZero".

    • Configure an External OAuth consent screen with:

      • the app name, the logo, and the support email at dupezero.com;
      • the privacy URL and terms URL on dupezero.com (pages must exist; if they don't yet, file it as a blocker);
      • the authorized domain dupezero.com;
      • scopes only openid, email and profile.

      These scopes are non-sensitive, so Google's security assessment is not needed. Branding verification is still needed before the "unverified app" interstitial goes away.

    • Publish the app to "In production".

  2. Create a Web application OAuth client. Register these redirect URIs exactly:

    • https://dupezero.com/api/auth/sso/google/callback
    • each dev hostname currently in use, one URI each, because Google does not accept wildcards
    • http://localhost:3000/api/auth/sso/google/callback

    Use a separate client for dev and prod, so that rotating the dev secret can never break prod.

  3. Store the secrets. Add ERWEB_OIDC_GOOGLE_CLIENT_ID and ERWEB_OIDC_GOOGLE_CLIENT_SECRET to the existing er/<env>/<ns>/erweb Secrets Manager secret.

    • Use aws secretsmanager put-secret-value, merging into the existing JSON. infra/terraform/envs/prod/secrets.tf:146-178 has ignore_changes = [secret_string], so Terraform will not do this, and that file already carries a comment saying the OIDC pairs belong there.
    • The External Secrets dataFrom.extract turns every key into an env var automatically, so no chart change is needed for the secrets.
  4. Declare the variables in frontend/src/lib/env.ts, the zod schema:

    • the two OIDC variables, as optional, so a deploy without them still boots with SSO off;
    • ERWEB_STAFF_GOOGLE_DOMAIN, defaulting to dupezero.com.

    Never use a NEXT_PUBLIC_ prefix; the semgrep rule enforces this.

  5. Set the public origin in prod. In infra/k8s/charts/er-platform/templates/deployment-web-api.yaml, take ERWEB_PUBLIC_BASE_URL out from under ingress.enabled and drive it from a value. Set that value to https://dupezero.com in values-prod.yaml, and to each dev namespace's hostname in its values file.

    • Side effect, and an intended one: invite and reset links become absolute instead of relative.
  6. Write the runbook. Add a short section to .claude/skills/infra-platform/references/infrastructure.md, next to :554, covering where the client lives, who owns the Google Cloud project, and how to rotate the secret.

Acceptance criteria

  • The consent screen is published, and branding verification is submitted or passed. A screenshot of the status goes in the ticket.
  • In the dev and prod web containers, both ERWEB_OIDC_GOOGLE_* variables are present. Check this by name only, for example with printenv | cut -d= -f1, and never print the values.
  • ERWEB_PUBLIC_BASE_URL is https://dupezero.com in prod, and a newly created invite link in prod is absolute.
  • With the variables removed, the app still boots, and SSO stays off.
  • The client secret exists only in Secrets Manager: not in git, not in values files, and not in CI.
  • The runbook section has been merged.

Out of scope

Depends on

Nothing. This ticket blocks #1399.

Where to start

  • infra/terraform/envs/prod/secrets.tf:146-178
  • infra/k8s/charts/er-platform/templates/deployment-web-api.yaml:178-194
  • frontend/src/lib/env.ts
  • Earlier design: .claude/skills/frontend-design-system/references/frontend-design.md §2.4; plan-to-aws.md Track S, S.1. SSO provider registrations #559 is superseded by this ticket.

Estimate: 0.5 engineer-weeks, plus Google's review time, which runs in the background.


Part of the E31 epic (#1396) (linked as parent). Decisions recorded 2026-11-28 with the owner.

Activity

  1. added
    post-mvp
    on Nov 29, 2026
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

    post-mvp

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions