Repository navigation
feat(auth): ask Google for the account chooser at sign-in - #258
Conversation
Send prompt=select_account with the authorize redirect, so a browser signed in to a personal Google account can switch to the @java.no account instead of being refused. Cognito forwards it to Google once the internal pool's domain is on managed login; until then it is ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Terraform Plan🚧 Changes detected — Plan: 5 to add, 1 to change, 0 to destroy. Plan outputLLM ReviewRisk: 🟡 MEDIUM Creates 5 networking/discovery resources for the cupcake-cupcake app (security group, ingress/egress rules, Cloud Map service, SSM parameter) and updates the ECS service to replace its security group with a new one, with 0 destroys.
|
Cognito managed login forwards prompt=select_account to Google only when the authorize request also names the IdP (identity_provider); without it the prompt is dropped. Read the IdP from the platform's COGNITO_IDENTITY_PROVIDER (aliased to NUXT_PUBLIC_OIDC_IDENTITY_PROVIDER) and send it when set. It is GoogleSAML today and becomes Google at the platform cutover, with no code change. Empty locally, where the request behaves as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Terraform Plan🚧 Changes detected — Plan: 6 to add, 1 to change, 1 to destroy. Plan outputLLM ReviewRisk: 🟡 MEDIUM Plan creates 6 networking/service-discovery/SSM resources for cupcake-cupcake, updates the ECS service in place to detach its old security group and register with service discovery, and replaces the task definition (revision 3) to add Cognito/OIDC env vars and secrets; no databases or public exposure are involved, but the task definition replacement and SG change need attention during apply.
|
… prompt (#176) ## Why The probe client (#174) showed that Cognito managed login forwards `prompt=select_account` to Google **only when the request also sends `identity_provider`**. `auth-doctor.py` always adds `identity_provider`, so an app that sends only `prompt` passed but would get no account chooser after the Google cutover (#175). ## What - New `chooser` check (WARN only): an app that renames auth variables via `auth.env` but doesn't alias `COGNITO_IDENTITY_PROVIDER` almost certainly doesn't send it. Apps that read the platform variables directly aren't flagged, since the doctor can't see their code. - The authorize warning and the docstring explain the `identity_provider` requirement. ## How verified - `python3 -m unittest discover -s scripts/tests`: 133 tests, OK. There are 4 new tests: aliased without IdP warns, aliased with IdP passes, no aliases passes, and the probe names the IdP. - `python3 -m unittest discover -s terraform/lambda-src/tests`: 219 tests, OK. - Live against the current pool: - frosting's `app.yaml` on main gets `WARN chooser`. - The `app.yaml` from javaBin/frosting#258, which aliases `COGNITO_IDENTITY_PROVIDER`, passes with no warning. ## Rollout Script only, with no Terraform changes. App deploys pick it up from platform `main`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Terraform Plan🚧 Changes detected — Plan: 6 to add, 1 to change, 1 to destroy. Plan outputLLM ReviewRisk: 🟡 MEDIUM Plan creates 6 networking/service-discovery/SSM resources for the cupcake app, updates its ECS service in place, and replaces its ECS task definition (1 destroy), with no database or internet-exposed security group changes.
|
Why
Heroes whose browser is signed in to a personal Google account cannot switch to their
@java.noaccount at sign-in (javaBin/platform#157). The platform now asks apps on the internal pool to sendprompt=select_account(COGNITO_EXTRA_AUTH_PARAMS, javaBin/platform#170).What
extraQueryParams: { prompt: "select_account" }on theoidc-client-tsUserManager, so it goes with everysigninRedirectto Cognito's/oauth2/authorize.How verified
pnpm lintandpnpm typecheckpass./oauth2/authorize?...&prompt=select_accountexactly as it does without the parameter (302 to the IdP), so this is safe to merge before the platform change.Rollout
Safe to merge any time. It takes effect once the platform's internal pool domain is on managed login (javaBin/platform#171) and the pool signs in with the Google provider (javaBin/platform#172). Sign-in behaviour does not change before then.
🤖 Generated with Claude Code
Update: also send
identity_providerProbing the platform's managed login (javaBin/platform#174) showed that Cognito forwards
prompt=select_accountto Google only when the request also setsidentity_provider. Withpromptalone, Cognito still goes straight to the client's only IdP but drops the prompt.app.yaml: aliasCOGNITO_IDENTITY_PROVIDER→NUXT_PUBLIC_OIDC_IDENTITY_PROVIDER. The platform writes it from the client's IdP:GoogleSAMLtoday,Googleafter the cutover (feat(identity): cut the internal pool over from GoogleSAML to Google platform#175).useAuth.ts: sendidentity_providerwithpromptwhen the value is set. It's empty locally, where requests behave as before.pnpm checkpasses.