[PR #7795] [MERGED] fix(microsoft): add verifyIdToken support for Microsoft Entra ID provider #24459

Closed
opened 2026-04-15 22:22:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7795
Author: @bytaesu
Created: 2/4/2026
Status: Merged
Merged: 2/4/2026
Merged by: @himself65

Base: canaryHead: 2026-02-04/fix/microsoft-verify-id-token


📝 Commits (2)

  • 0c171dc fix(microsoft): add verifyIdToken support for Microsoft Entra ID provider
  • bc6c8f1 fix: cspell

📊 Changes

2 files changed (+461 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/social.test.ts (+377 -0)
📝 packages/core/src/social-providers/microsoft-entra-id.ts (+84 -1)

📄 Description


Summary by cubic

Adds verifyIdToken support to the Microsoft Entra ID provider, enabling secure ID token sign-in via Microsoft JWKS or a custom verifier. Also adds tenant-aware issuer checks and an option to disable ID token sign-in.

  • New Features
    • Default ID token verification using discovery v2.0 JWKS and jose jwtVerify (audience=clientId, max age 1h, optional nonce).
    • Custom verifyIdToken(token, nonce) hook to override verification.
    • Tenant-aware issuer validation when tenantId is set; skipped for common/organizations/consumers.
    • disableIdTokenSignIn option to block ID token flows.
    • getMicrosoftPublicKey helper to fetch and import keys by kid.

Written for commit bc6c8f16fd. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7795 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 2/4/2026 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2026-02-04/fix/microsoft-verify-id-token` --- ### 📝 Commits (2) - [`0c171dc`](https://github.com/better-auth/better-auth/commit/0c171dc0ef60c1626a642ded15abfcc9bab45ce6) fix(microsoft): add verifyIdToken support for Microsoft Entra ID provider - [`bc6c8f1`](https://github.com/better-auth/better-auth/commit/bc6c8f16fd824bb62fcd2f32e0ba857eb3d7baaa) fix: cspell ### 📊 Changes **2 files changed** (+461 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/social.test.ts` (+377 -0) 📝 `packages/core/src/social-providers/microsoft-entra-id.ts` (+84 -1) </details> ### 📄 Description - Closes https://github.com/better-auth/better-auth/issues/7776 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds verifyIdToken support to the Microsoft Entra ID provider, enabling secure ID token sign-in via Microsoft JWKS or a custom verifier. Also adds tenant-aware issuer checks and an option to disable ID token sign-in. - **New Features** - Default ID token verification using discovery v2.0 JWKS and jose jwtVerify (audience=clientId, max age 1h, optional nonce). - Custom verifyIdToken(token, nonce) hook to override verification. - Tenant-aware issuer validation when tenantId is set; skipped for common/organizations/consumers. - disableIdTokenSignIn option to block ID token flows. - getMicrosoftPublicKey helper to fetch and import keys by kid. <sup>Written for commit bc6c8f16fd824bb62fcd2f32e0ba857eb3d7baaa. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 22:22:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#24459