[PR #4794] [CLOSED] feat(sso): extend ssoProvider schema with customizable fields and add… #22481

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4794
Author: @KaiSoellch
Created: 9/21/2025
Status: Closed

Base: canaryHead: feat-sso-additional-fields


📝 Commits (10+)

  • fde9fe0 feat(sso): extend ssoProvider schema with customizable fields and additionalFields support
  • 6e21fc4 Merge branch 'canary' into feat-sso-additional-fields
  • 82b86af style: format code with biome
  • 2a19478 Merge branch 'canary' into feat-sso-additional-fields
  • c330cfd Merge branch 'canary' into feat-sso-additional-fields
  • 524741c Merge branch 'canary' into feat-sso-additional-fields
  • 668e202 fix: remove type wrapping for ts determination
  • 0a2ea47 Merge branch 'canary' into feat-sso-additional-fields
  • fa6e851 Merge branch 'canary' into feat-sso-additional-fields
  • bddbbbb Merge branch 'canary' into feat-sso-additional-fields

📊 Changes

8 files changed (+575 additions, -38 deletions)

View changed files

📝 docs/content/docs/plugins/sso.mdx (+2 -0)
📝 packages/better-auth/src/plugins/sso/index.ts (+14 -0)
packages/better-auth/src/plugins/sso/schema.ts (+48 -0)
📝 packages/better-auth/src/plugins/sso/sso.test.ts (+58 -0)
📝 packages/sso/src/index.ts (+13 -38)
packages/sso/src/schema.test.ts (+168 -0)
packages/sso/src/schema.ts (+59 -0)
📝 pnpm-lock.yaml (+213 -0)

📄 Description

…itionalFields support


Summary by cubic

Adds schema customization to the SSO plugin so you can rename built-in columns, set a custom table name, and add extra fields to the ssoProvider model. Also updates types to infer the augmented SSOProvider and adds docs and tests.

  • New Features
    • New schema.ssoProvider options: modelName, fields (column name mapping), and additionalFields (full FieldAttribute support).
    • Built-in fields now accept fieldName overrides: issuer, oidcConfig, samlConfig, userId, providerId, organizationId, domain.
    • Type inference: expose $Infer.SSOProvider and InferSSOProvider to include additional fields in the SSOProvider type.
    • Tests verify additionalFields persistence with defaultValue (e.g., environment: "prod").

🔄 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/4794 **Author:** [@KaiSoellch](https://github.com/KaiSoellch) **Created:** 9/21/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `feat-sso-additional-fields` --- ### 📝 Commits (10+) - [`fde9fe0`](https://github.com/better-auth/better-auth/commit/fde9fe094d9265b54e06ac7ff6aa06d1ce770fc7) feat(sso): extend ssoProvider schema with customizable fields and additionalFields support - [`6e21fc4`](https://github.com/better-auth/better-auth/commit/6e21fc401d781c597e8296f827d3f6920e7b4a38) Merge branch 'canary' into feat-sso-additional-fields - [`82b86af`](https://github.com/better-auth/better-auth/commit/82b86af050e02673cb4e9473c2de150b9a2898c0) style: format code with biome - [`2a19478`](https://github.com/better-auth/better-auth/commit/2a19478cf65a1bfa68adb6c54222938cc9ec44c8) Merge branch 'canary' into feat-sso-additional-fields - [`c330cfd`](https://github.com/better-auth/better-auth/commit/c330cfd75fb1ca01bca477e2d427570c84c90e71) Merge branch 'canary' into feat-sso-additional-fields - [`524741c`](https://github.com/better-auth/better-auth/commit/524741cb4e2132d07cd4a44585047ce02243efb4) Merge branch 'canary' into feat-sso-additional-fields - [`668e202`](https://github.com/better-auth/better-auth/commit/668e202a684613fb4f8d3c94533f04de2f1dabed) fix: remove type wrapping for ts determination - [`0a2ea47`](https://github.com/better-auth/better-auth/commit/0a2ea47dd1cb1cb8a6e23751670e6afecd42cfe3) Merge branch 'canary' into feat-sso-additional-fields - [`fa6e851`](https://github.com/better-auth/better-auth/commit/fa6e85144b9865e7f015d97614c84564e18fd5e6) Merge branch 'canary' into feat-sso-additional-fields - [`bddbbbb`](https://github.com/better-auth/better-auth/commit/bddbbbb0b8dad105ecca49fd53cc600a65d9d976) Merge branch 'canary' into feat-sso-additional-fields ### 📊 Changes **8 files changed** (+575 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/sso.mdx` (+2 -0) 📝 `packages/better-auth/src/plugins/sso/index.ts` (+14 -0) ➕ `packages/better-auth/src/plugins/sso/schema.ts` (+48 -0) 📝 `packages/better-auth/src/plugins/sso/sso.test.ts` (+58 -0) 📝 `packages/sso/src/index.ts` (+13 -38) ➕ `packages/sso/src/schema.test.ts` (+168 -0) ➕ `packages/sso/src/schema.ts` (+59 -0) 📝 `pnpm-lock.yaml` (+213 -0) </details> ### 📄 Description …itionalFields support <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds schema customization to the SSO plugin so you can rename built-in columns, set a custom table name, and add extra fields to the ssoProvider model. Also updates types to infer the augmented SSOProvider and adds docs and tests. - **New Features** - New schema.ssoProvider options: modelName, fields (column name mapping), and additionalFields (full FieldAttribute support). - Built-in fields now accept fieldName overrides: issuer, oidcConfig, samlConfig, userId, providerId, organizationId, domain. - Type inference: expose $Infer.SSOProvider and InferSSOProvider to include additional fields in the SSOProvider type. - Tests verify additionalFields persistence with defaultValue (e.g., environment: "prod"). <!-- 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:04:41 -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#22481