Skip to content

BE-477: Add Microsoft/Azure AD OIDC SSO provider#8578

Open
TimDiekmann wants to merge 2 commits intot/be-476-set-up-google-oidc-ssofrom
t/be-477-set-up-microsoftazure-ad-oidc-sso
Open

BE-477: Add Microsoft/Azure AD OIDC SSO provider#8578
TimDiekmann wants to merge 2 commits intot/be-476-set-up-google-oidc-ssofrom
t/be-477-set-up-microsoftazure-ad-oidc-sso

Conversation

@TimDiekmann
Copy link
Copy Markdown
Member

@TimDiekmann TimDiekmann commented Mar 25, 2026

🌟 What is the purpose of this PR?

Add Microsoft/Azure AD as second OIDC provider, building on the Google SSO foundation from BE-476.

🔗 Related links

🔍 What does this change?

  • Add Microsoft OIDC provider config in kratos.yml
  • Add Jsonnet claims mapper for Microsoft (handles email, preferred_username, upn)
  • Add docker-compose env vars for Microsoft client_id, client_secret, tenant_id

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🛡 What tests cover this?

  • Manual testing: Microsoft OIDC login flow on local and staging

❓ How to test this?

Tested and verified on staging with Azure AD accounts.

🎥 Demo

image

@cursor
Copy link
Copy Markdown

cursor bot commented Mar 25, 2026

PR Summary

Medium Risk
Adds a new OIDC/SSO identity provider and claims-mapping logic in Kratos, which can affect authentication flows when enabled. Change is gated behind existing OIDC enablement but misconfiguration could block SSO sign-in or incorrectly map emails.

Overview
Adds Microsoft/Azure AD as a second Kratos OIDC provider alongside Google, wired into kratos.yml with its own mapper_url, scopes, and tenant/client credentials.

Introduces oidc.microsoft.jsonnet to derive the user email from email/preferred_username/upn claims and set verified_addresses, and updates docker-compose.yml to surface Microsoft client_id, client_secret, and tenant_id env vars (still disabled by default via KRATOS_OIDC_ENABLED).

Written by Cursor Bugbot for commit ab68a72. This will update automatically on new commits. Configure here.

@github-actions github-actions bot added area/apps > hash* Affects HASH (a `hash-*` app) area/apps labels Mar 25, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Mar 25, 2026 6:31pm
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign Ignored Ignored Preview Mar 25, 2026 6:31pm
hashdotdesign-tokens Ignored Ignored Preview Mar 25, 2026 6:31pm
petrinaut Skipped Skipped Mar 25, 2026 6:31pm

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 25, 2026

🤖 Augment PR Summary

Summary: Adds Microsoft/Azure AD (Entra ID) as a second OIDC SSO provider alongside the existing Google OIDC integration.

Changes:

  • Introduces a Microsoft-specific claims mapper (`oidc.microsoft.jsonnet`) to derive the user email from available token claims.
  • Registers the Microsoft OIDC provider in Kratos config with the new mapper and requested scopes.
  • Extends local dev Docker Compose env wiring for Microsoft `client_id`, `client_secret`, and tenant configuration.
Technical Notes: The mapper prioritizes `email`, then `preferred_username`, then `upn` for populating `traits.emails` and verification state.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@github-actions github-actions bot added the type/eng > frontend Owned by the @frontend team label Mar 25, 2026
@TimDiekmann TimDiekmann force-pushed the t/be-477-set-up-microsoftazure-ad-oidc-sso branch from 8e31e16 to e985544 Compare March 25, 2026 16:38
@github-actions github-actions bot removed the type/eng > frontend Owned by the @frontend team label Mar 25, 2026
@vercel vercel bot temporarily deployed to Preview – petrinaut March 25, 2026 16:50 Inactive
- Add Microsoft OIDC provider config in kratos.yml with tenant env var
- Add Microsoft Jsonnet mapper (handles email/preferred_username/upn)
- Add docker-compose env vars for Microsoft client_id, secret, tenant_id
- Style flow messages based on type (red for errors, blue for info)
- Guard Microsoft Jsonnet upn claim with existence check
- Check email_verified claim in Microsoft mapper when present
- Add Microsoft env vars to .env.local setup comment
@TimDiekmann TimDiekmann force-pushed the t/be-477-set-up-microsoftazure-ad-oidc-sso branch from e985544 to ab68a72 Compare March 25, 2026 18:18
@vercel vercel bot temporarily deployed to Preview – petrinaut March 25, 2026 18:18 Inactive
Copy link
Copy Markdown
Member Author

TimDiekmann commented Mar 25, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash* Affects HASH (a `hash-*` app) area/apps

Development

Successfully merging this pull request may close these issues.

2 participants