BE-476: Add Google OIDC SSO support via Ory Kratos#8576
BE-476: Add Google OIDC SSO support via Ory Kratos#8576TimDiekmann wants to merge 9 commits intomainfrom
Conversation
- Configure Kratos OIDC method with Google provider (disabled by default) - Add OIDC registration webhook (reuses existing HASH user creation) - Route OIDC callbacks through API proxy (/auth) via base_redirect_uri - Add SsoProviderButtons component to sign-in page - Add brand icons for Google, Apple, Microsoft, GitHub, GitLab To enable locally, set in .env.local: KRATOS_OIDC_ENABLED=true KRATOS_OIDC_GOOGLE_CLIENT_ID=<your-client-id> KRATOS_OIDC_GOOGLE_CLIENT_SECRET=<your-client-secret>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
PR SummaryHigh Risk Overview Updates the sign-in UI to surface OIDC providers from the Kratos login flow via new Written by Cursor Bugbot for commit d4c797b. This will update automatically on new commits. Configure here. |
🤖 Augment PR SummarySummary: Adds Google OIDC SSO support to HASH via Ory Kratos, plus UI affordances to sign in with configured OIDC providers. Changes:
Technical Notes: OIDC is disabled by default and is enabled via 🤖 Was this summary useful? React with 👍 or 👎 |
Adds support for automatic account linking mode (account_linking_mode) and improves OIDC account linking flows.
- Show account linking message in styled info box above form fields - Pre-fill and disable email field during account linking flow - Auto-focus password field when email is pre-filled
- Narrow SsoProviderButtons flow prop to LoginFlow (not RegistrationFlow) - Fix unhandled promise rejection in SSO error handler - Clean up type casts in redirect_browser_to check - Move ui.messages rendering before aal2/non-aal2 branch so messages are shown for all flow types
- Add format-kratos-message.tsx for human-friendly Kratos messages - Replace message 1010016 with clean text, bold email and provider name - Add provider label to Kratos config - Fix floating promise in SSO error handler (void instead of swallowing .catch)
- Add format-kratos-message.tsx with custom message for account linking (bold email + provider name, no quotes) - Add provider label to Kratos config for display name - Use shared providerDisplayNames map in SSO buttons (fixes GitHub/GitLab casing) - Fix floating promise in SSO error handler (void instead of swallowing .catch) - Pre-fill email from Kratos flow and focus password field via ref
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
lunelson
left a comment
There was a problem hiding this comment.
Is it possible to get e2e test coverage on this?
|
@lunelson Not for the full OAuth flow, no. Google/Microsoft have bot detection that prevents automated browser login. What we could test:
The actual OAuth redirect -> provider login -> callback chain requires manual testing or a mock OIDC provider (e.g. Dex). For now this was manually tested on local + staging (the infra is already prepared by now) with both Google and Microsoft accounts. However, to test this, we need OIDC to be set up in CI, which we currently don't have. I would defer that to another task. We also surprisingly don't have unit testing set up for the frontend, which would be out of scope of this PR. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |


🌟 What is the purpose of this PR?
Add SSO (Single Sign-On) support to HASH via Google OIDC. This sets up the foundation for external identity provider login — Google first, more providers to follow.
🔗 Related links
🔍 What does this change?
Kratos OIDC Configuration:
kratos.yml)oidc.google.jsonnet) for Google → Kratos trait mappingbase_redirect_uriKRATOS_OIDC_ENABLED=true+ credentials in.env.localFrontend:
SsoProviderButtonscomponent to sign-in page (right sidebar)Docker Compose:
${KRATOS_OIDC_ENABLED:-false}defaultPre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🐾 Next steps
automaticaccount linking mode for Google consumer accounts🛡 What tests cover this?
❓ How to test this?
.env.local:docker compose -f apps/hash-external-services/docker-compose.yml build kratosyarn devhttp://localhost:3000/signin🎥 Demo