Title: Internal login fails with Google `403 app_not_configured_for_user` when another Google account is active · Issue #157 · javaBin/platform · GitHub
Open Graph Title: Internal login fails with Google `403 app_not_configured_for_user` when another Google account is active · Issue #157 · javaBin/platform
X Title: Internal login fails with Google `403 app_not_configured_for_user` when another Google account is active · Issue #157 · javaBin/platform
Description: Problem Apps on the internal Cognito pool (e.g. cupcake/frosting) sign users in through the GoogleSAML identity provider, a Google Workspace SAML app. If the user's browser has a different Google account active, such as a personal Gmail,...
Open Graph Description: Problem Apps on the internal Cognito pool (e.g. cupcake/frosting) sign users in through the GoogleSAML identity provider, a Google Workspace SAML app. If the user's browser has a different Google a...
X Description: Problem Apps on the internal Cognito pool (e.g. cupcake/frosting) sign users in through the GoogleSAML identity provider, a Google Workspace SAML app. If the user's browser has a different Goog...
Opengraph URL: https://github.com/javaBin/platform/issues/157
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Internal login fails with Google `403 app_not_configured_for_user` when another Google account is active","articleBody":"### Problem\n\nApps on the internal Cognito pool (e.g. cupcake/frosting) sign users in through the `GoogleSAML` identity provider, a Google Workspace SAML app. If the user's browser has a different Google account active, such as a personal Gmail, Google uses that account for the SAML request and returns:\n\n> 403 — Error: app_not_configured_for_user\n\nGoogle's error page has no way to switch accounts, so the user is stuck. The only workaround is signing out of Google, or using a private window.\n\n### Why it can't be fixed in the Cognito console\n\n- SAML has no \"choose an account\" parameter. Google always uses the active session.\n- Cognito's `prompt=select_account` on `/oauth2/authorize` is forwarded to IdPs only on **managed login**, not the classic hosted UI ([docs](https://docs.aws.amazon.com/cognito/latest/developerguide/authorization-endpoint.html)). The internal pool doesn't set `managed_login_version`, so it should be on classic (to confirm: Cognito → User pool → Domain → Branding version).\n- The docs describe forwarding `prompt` as an addition to the IdP's redirect URL, i.e. for OIDC/social providers. I found nothing documenting that Cognito maps it to SAML `ForceAuthn`. Even if it did, Google would re-ask the password for the *same* account rather than offer a choice.\n\n### Proposal: use the Google OIDC provider for the internal pool\n\n`terraform/platform/identity/main.tf` already defines `aws_cognito_identity_provider.internal_google`, but it isn't created because `google_client_id` is empty. Google's OAuth endpoint supports what we need:\n\n- `prompt=select_account` always shows the account chooser, including \"Use another account\".\n- `hd=java.no`, already in `authorize_url`, narrows the chooser to java.no accounts.\n\nSteps:\n\n1. Create the OAuth client in GCP project `javabin-platform`, following `docs/cognito-google-setup.md` §1, and set `google_client_id` / `google_client_secret`.\n2. Add `prompt=select_account` to the provider's `authorize_url`, next to `hd=`. That works on the classic hosted UI. Moving the pool to managed login, so apps can pass `prompt` themselves, is an alternative.\n3. Add `Google` to app clients' `SupportedIdentityProviders`. `app_auth_sync` already includes every IdP on the pool, so this may only need a resync. Decide whether `GoogleSAML` stays as well or is removed.\n4. Enforce the domain server-side. `hd=` is only a UI hint (see the existing TODO). Check that `auth_claims` rejects non-java.no users, or add a check that does.\n\n### Things to check before switching\n\n- **User identities:** OIDC users get a new Cognito identity (`username = sub`), not linked to their existing `GoogleSAML` user. Check whether anything depends on the Cognito username or `sub` staying the same, and whether the old SAML users should be linked or cleaned up.\n- **Login page:** if both IdPs are enabled, the hosted UI shows two buttons. Apps can skip that page by passing `identity_provider=Google` on `/oauth2/authorize`.\n\n### Done when\n\nA user whose browser is signed in to a personal Gmail (and possibly a java.no account too) is shown Google's account chooser at login, picks their java.no account, and is signed in to the app.\n","author":{"url":"https://github.com/chrissearle","@type":"Person","name":"chrissearle"},"datePublished":"2026-10-24T13:03:26Z","url":"https://github.com/javaBin/platform/issues/157"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:dbff33ef-2f0e-e509-ef34-6ab7c8b316b0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F68:2A7CD2:1860734:20DA5D6:6B03F6F1 |
| html-safe-nonce | 666bdb8bffccbfdbd61942de7fd5d734b9f28f4ce7130b885f240ac804085ccd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjY4OjJBN0NEMjoxODYwNzM0OjIwREE1RDY6NkIwM0Y2RjEiLCJ2aXNpdG9yX2lkIjoiMzEzODAzNzYzNTIxODY2NzI0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | df9fc5264c93bc8b38faa6f6f01b9a9033a7c3bcfd81c243925273b24fd456b9 |
| hovercard-subject-tag | issue:6013223227 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/javaBin/platform/157/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6ffffefbe04cc72671fe753e15d5d85b6a3d100043cdd22d8aa9f74b61b4acb3/javaBin/platform/issues/157 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6ffffefbe04cc72671fe753e15d5d85b6a3d100043cdd22d8aa9f74b61b4acb3/javaBin/platform/issues/157 |
| og:image:alt | Problem Apps on the internal Cognito pool (e.g. cupcake/frosting) sign users in through the GoogleSAML identity provider, a Google Workspace SAML app. If the user's browser has a different Google a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chrissearle |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/javaBin/platform git https://github.com/javaBin/platform.git |
| octolytics-dimension-user_id | 95047 |
| octolytics-dimension-user_login | javaBin |
| octolytics-dimension-repository_id | 1175354559 |
| octolytics-dimension-repository_nwo | javaBin/platform |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1175354559 |
| octolytics-dimension-repository_network_root_nwo | javaBin/platform |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width