[PR #3886] [CLOSED] feat(generic-oauth): support dynamic registration #30664

Closed
opened 2026-04-17 21:42:05 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3886
Author: @ping-maxwell
Created: 8/8/2025
Status: Closed

Base: canaryHead: update/generic-oauth/dynamic-registration


📝 Commits (10+)

📊 Changes

7 files changed (+498 additions, -19 deletions)

View changed files

📝 docs/content/docs/plugins/generic-oauth.mdx (+25 -4)
📝 packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts (+70 -0)
packages/better-auth/src/plugins/generic-oauth/get-client-id-and-secret.ts (+111 -0)
packages/better-auth/src/plugins/generic-oauth/get-user-info.ts (+59 -0)
📝 packages/better-auth/src/plugins/generic-oauth/index.ts (+45 -15)
packages/better-auth/src/plugins/generic-oauth/schema.ts (+20 -0)
packages/better-auth/src/plugins/generic-oauth/types.ts (+168 -0)

📄 Description

  • Adds new oauthRegistration model to save previously registered oauth providers.
  • Adds functionality to fetch the oauth provider's register endpoint and grab the client_id & client_secret, then saves to DB.
  • tests
  • docs

Summary by cubic

Added dynamic client registration to the generic OAuth plugin so providers can register clients at runtime and avoid static credentials. The client is registered on first use, saved to the DB, and reused in later flows.

  • New Features
    • Supports dynamic registration with registrationEndpoint, clientName, and clientUri.
    • Persists client_id and client_secret in the oauthRegistration model and merges the plugin schema.
    • Uses registered credentials across authorization, token, and refresh flows; updated types, docs, and tests.

Written for commit c1f4e9b9fe. 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/3886 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 8/8/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `update/generic-oauth/dynamic-registration` --- ### 📝 Commits (10+) - [`321e2cf`](https://github.com/better-auth/better-auth/commit/321e2cf562502b11ff3345909b870f7b3bb489a9) update(generic-oauth): support dynamic registration - [`2a24dfa`](https://github.com/better-auth/better-auth/commit/2a24dfabbab7f0d04503cadbdb37443f6a9e8967) fix - [`75e2689`](https://github.com/better-auth/better-auth/commit/75e26892ce6378a7d58b94154627279add121106) improved error logging - [`a9fe412`](https://github.com/better-auth/better-auth/commit/a9fe4120fe04a3983cc491d02ffd86395633461e) fix - [`5fd4978`](https://github.com/better-auth/better-auth/commit/5fd49782d664ddfe6ffdf57e3b4f6ffc1b8361ba) fix - [`80454ea`](https://github.com/better-auth/better-auth/commit/80454eab66c87ca2cda57ab07dc83ed588b20990) fix - [`b7ae85c`](https://github.com/better-auth/better-auth/commit/b7ae85cc187558455b606ba87631c1c3a32a8c44) fix - [`856b4b3`](https://github.com/better-auth/better-auth/commit/856b4b38b77c0a02277eb65d2762cbe66a9097ac) remove useless props - [`c2409cc`](https://github.com/better-auth/better-auth/commit/c2409cc0a9e956d1db782a489857d5806621e727) cleanup - [`b2c4b85`](https://github.com/better-auth/better-auth/commit/b2c4b85e5db75e6dbc7c5e35c4d2788bc7d4b392) chore: lint ### 📊 Changes **7 files changed** (+498 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/generic-oauth.mdx` (+25 -4) 📝 `packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts` (+70 -0) ➕ `packages/better-auth/src/plugins/generic-oauth/get-client-id-and-secret.ts` (+111 -0) ➕ `packages/better-auth/src/plugins/generic-oauth/get-user-info.ts` (+59 -0) 📝 `packages/better-auth/src/plugins/generic-oauth/index.ts` (+45 -15) ➕ `packages/better-auth/src/plugins/generic-oauth/schema.ts` (+20 -0) ➕ `packages/better-auth/src/plugins/generic-oauth/types.ts` (+168 -0) </details> ### 📄 Description * Adds new `oauthRegistration` model to save previously registered oauth providers. * Adds functionality to fetch the oauth provider's register endpoint and grab the client_id & client_secret, then saves to DB. * [x] tests * [x] docs <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added dynamic client registration to the generic OAuth plugin so providers can register clients at runtime and avoid static credentials. The client is registered on first use, saved to the DB, and reused in later flows. - **New Features** - Supports dynamic registration with registrationEndpoint, clientName, and clientUri. - Persists client_id and client_secret in the oauthRegistration model and merges the plugin schema. - Uses registered credentials across authorization, token, and refresh flows; updated types, docs, and tests. <sup>Written for commit c1f4e9b9fe5f3c303b11e317c276c7876f57af2f. 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-17 21:42:05 -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#30664