BE-477: Add Microsoft/Azure AD OIDC SSO provider#8578
Conversation
PR SummaryMedium Risk Overview Updates Extends Written by Cursor Bugbot for commit 6dd8021. This will update automatically on new commits. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
🤖 Augment PR SummarySummary: Adds Microsoft/Azure AD (Entra ID) as a second OIDC SSO provider alongside the existing Google OIDC integration.
🤖 Was this summary useful? React with 👍 or 👎 |
apps/hash-external-services/kratos/hooks/oidc.microsoft.jsonnet
Outdated
Show resolved
Hide resolved
apps/hash-external-services/kratos/hooks/oidc.microsoft.jsonnet
Outdated
Show resolved
Hide resolved
apps/hash-external-services/kratos/hooks/oidc.microsoft.jsonnet
Outdated
Show resolved
Hide resolved
8e31e16 to
e985544
Compare
e985544 to
ab68a72
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Could not find data on the previous version of this PR; see action logs at https://github.com/hashintel/hash/actions/runs/23908536429
- 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
ab68a72 to
6dd8021
Compare
Merge activity
|
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.
| mapper_url: "file:///etc/config/kratos/hooks/oidc.microsoft.jsonnet" | ||
| scope: | ||
| - profile |
There was a problem hiding this comment.
Missing requested_claims makes email verification check ineffective
Medium Severity
The Microsoft provider in kratos.yml doesn't include requested_claims for email_verified (unlike the Google provider), so Microsoft will almost never include email_verified in the ID token. This means the email_verified check in oidc.microsoft.jsonnet is effectively dead code — the mapper will always fall into the else branch that unconditionally marks emails as verified. Combined with the preferred_username/upn fallback chain, any value Microsoft returns gets auto-verified without actual verification.



🌟 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?
kratos.ymlemail,preferred_username,upn)client_id,client_secret,tenant_idPre-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:
🛡 What tests cover this?
❓ How to test this?
Tested and verified on staging with Azure AD accounts.
🎥 Demo