[PR #5842] [CLOSED] feat(sso): add optional support for domain verification #23170

Closed
opened 2026-04-15 21:31:48 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5842
Author: @jonathansamines
Created: 11/7/2025
Status: Closed

Base: canaryHead: feat/sso-domain-verification


📝 Commits (10+)

  • a337d54 feat(sso): add domain verification support
  • 270cb90 chore(sso): refactor to allow for optional endpoints
  • b4aa3e5 docs(sso): fix documentation innacuracies
  • 3e08a5b chore(sso): fix fake timers issues
  • ba98ffb chore(sso): fix type annotations
  • 85e16d2 chore(sso): add support for custom domain verification prefix
  • 116e6fa docs(sso): add docs for verification token prefix
  • 19f717f chore(sso): fix lint issues
  • d8d576f chore(sso): change zod to star import
  • ca31a01 chore(sso): remove unnecessary type annotation

📊 Changes

7 files changed (+3430 additions, -2245 deletions)

View changed files

📝 docs/content/docs/plugins/sso.mdx (+150 -1)
📝 packages/sso/src/client.ts (+20 -3)
packages/sso/src/domain-verification.test.ts (+542 -0)
📝 packages/sso/src/index.ts (+81 -2241)
packages/sso/src/routes/domain-verification.ts (+265 -0)
packages/sso/src/routes/sso.ts (+2137 -0)
packages/sso/src/types.ts (+235 -0)

📄 Description

Summary by cubic

Adds optional domain verification to the SSO plugin and client. Verifies provider domains via DNS TXT tokens and automatically trusts verified domains.

  • New Features

    • POST /sso/request-domain-verification to submit a provider for verification.
    • Issues verification tokens and checks DNS TXT records.
    • Supports configurable DNS TXT record prefix.
    • OIDC/SAML routes enforce verification status and provider ownership.
    • Endpoints register only when the feature is enabled.
  • Migration

    • If enabled, run: npx @better-auth/cli migrate and npx @better-auth/cli generate to apply schema changes.

Written for commit b1dda426f9. Summary will update automatically 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/5842 **Author:** [@jonathansamines](https://github.com/jonathansamines) **Created:** 11/7/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `feat/sso-domain-verification` --- ### 📝 Commits (10+) - [`a337d54`](https://github.com/better-auth/better-auth/commit/a337d54a526e2008ca3359b1d1b95382ffa0b4dd) feat(sso): add domain verification support - [`270cb90`](https://github.com/better-auth/better-auth/commit/270cb9097c10ced1ec56611a7457c6c1d0c15297) chore(sso): refactor to allow for optional endpoints - [`b4aa3e5`](https://github.com/better-auth/better-auth/commit/b4aa3e5caf37f643e709d803e1a7df8f4d85ce28) docs(sso): fix documentation innacuracies - [`3e08a5b`](https://github.com/better-auth/better-auth/commit/3e08a5be7d9c325f7b9ab3fbac2a55d4f981b154) chore(sso): fix fake timers issues - [`ba98ffb`](https://github.com/better-auth/better-auth/commit/ba98ffbf4bcb90723bf60ce313138c9bd791b8d1) chore(sso): fix type annotations - [`85e16d2`](https://github.com/better-auth/better-auth/commit/85e16d287e5074203d7a6a850fd21595acd48279) chore(sso): add support for custom domain verification prefix - [`116e6fa`](https://github.com/better-auth/better-auth/commit/116e6fa964e39fb7e57f9c62ece03d2cc83dd3d5) docs(sso): add docs for verification token prefix - [`19f717f`](https://github.com/better-auth/better-auth/commit/19f717f9cb1f3ffe6f3136e8a7602332994ea6c6) chore(sso): fix lint issues - [`d8d576f`](https://github.com/better-auth/better-auth/commit/d8d576f041585ee1f0ccb302e72b5db98e51304f) chore(sso): change zod to star import - [`ca31a01`](https://github.com/better-auth/better-auth/commit/ca31a01dd9a69401370721f37a34d28885dd0d8a) chore(sso): remove unnecessary type annotation ### 📊 Changes **7 files changed** (+3430 additions, -2245 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/sso.mdx` (+150 -1) 📝 `packages/sso/src/client.ts` (+20 -3) ➕ `packages/sso/src/domain-verification.test.ts` (+542 -0) 📝 `packages/sso/src/index.ts` (+81 -2241) ➕ `packages/sso/src/routes/domain-verification.ts` (+265 -0) ➕ `packages/sso/src/routes/sso.ts` (+2137 -0) ➕ `packages/sso/src/types.ts` (+235 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Adds optional domain verification to the SSO plugin and client. Verifies provider domains via DNS TXT tokens and automatically trusts verified domains. - **New Features** - POST /sso/request-domain-verification to submit a provider for verification. - Issues verification tokens and checks DNS TXT records. - Supports configurable DNS TXT record prefix. - OIDC/SAML routes enforce verification status and provider ownership. - Endpoints register only when the feature is enabled. - **Migration** - If enabled, run: npx @better-auth/cli migrate and npx @better-auth/cli generate to apply schema changes. <sup>Written for commit b1dda426f94ad55016a96d2f91a67d739dfe6117. Summary will update automatically 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 21:31:48 -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#23170