[PR #3535] [CLOSED] feat(oidc,mcp): upgrades to oauth registration #21772

Closed
opened 2026-04-15 20:35:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3535
Author: @dvanmali
Created: 7/22/2025
Status: Closed

Base: mainHead: oidc-register


📝 Commits (6)

  • ccf9d1b feat: register endpoint externalized, add unauthenticated registration flag, registion scopes, rename oauthApplication to oauthClient
  • 73cd2f0 style: fixes code-dev-ai suggestions
  • 0b20f4a Merge branch 'main' into oidc-register
  • c268f4d fix: merge conflicts
  • c819cce docs: add changesets
  • 66e0bc0 docs: ensure oauthApplication types match docs

📊 Changes

16 files changed (+1793 additions, -1046 deletions)

View changed files

.changeset/lazy-eels-peel.md (+5 -0)
.changeset/smooth-masks-film.md (+5 -0)
.changeset/tired-bananas-fetch.md (+5 -0)
📝 docs/content/docs/plugins/oidc-provider.mdx (+173 -64)
packages/better-auth/src/oauth2.1/types.ts (+12 -0)
📝 packages/better-auth/src/plugins/jwt/index.ts (+8 -0)
📝 packages/better-auth/src/plugins/mcp/authorize.ts (+10 -8)
📝 packages/better-auth/src/plugins/mcp/index.ts (+78 -148)
📝 packages/better-auth/src/plugins/mcp/mcp.test.ts (+96 -134)
📝 packages/better-auth/src/plugins/oidc-provider/authorize.ts (+5 -9)
📝 packages/better-auth/src/plugins/oidc-provider/index.ts (+196 -347)
📝 packages/better-auth/src/plugins/oidc-provider/oidc.test.ts (+260 -261)
packages/better-auth/src/plugins/oidc-provider/register.test.ts (+286 -0)
packages/better-auth/src/plugins/oidc-provider/register.ts (+390 -0)
📝 packages/better-auth/src/plugins/oidc-provider/schema.ts (+77 -13)
📝 packages/better-auth/src/plugins/oidc-provider/types.ts (+187 -62)

📄 Description

feat: additional registration endpoint unit tests

feat: clientRegistrationDefaultScopes and clientRegistrationAllowedScopes specifies default and allowed scopes during registration

fix: removes invalid grant types from being added into the application: "implicit" & "password" should be deprecated by security recommendations, "urn:ietf:params:oauth:grant-type:jwt-bearer" & "urn:ietf:params:oauth:grant-type:saml2-bearer" are unimplemented.

chore: registration endpoint code for mcp and oidc plugins are now shared

Partial #3458


Summary by cubic

Improved OAuth client registration by externalizing the register endpoint, adding support for unauthenticated registration, and updating scope handling. Removed deprecated and unimplemented grant types.

  • New Features

    • Shared registration endpoint for OIDC and MCP plugins.
    • Added allowUnauthenticatedClientRegistration flag.
    • Introduced clientRegistrationDefaultScopes and clientRegistrationAllowedScopes for better scope control.
  • Bug Fixes

    • Removed unsupported grant types ("implicit", "password", "jwt-bearer", "saml2-bearer").
    • Added and updated unit tests for registration.

🔄 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/3535 **Author:** [@dvanmali](https://github.com/dvanmali) **Created:** 7/22/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `oidc-register` --- ### 📝 Commits (6) - [`ccf9d1b`](https://github.com/better-auth/better-auth/commit/ccf9d1b3bff5a6f175da944f09d12134309a3a1b) feat: register endpoint externalized, add unauthenticated registration flag, registion scopes, rename oauthApplication to oauthClient - [`73cd2f0`](https://github.com/better-auth/better-auth/commit/73cd2f0fdcf766612300cb6e93a99aa3377ce5ab) style: fixes code-dev-ai suggestions - [`0b20f4a`](https://github.com/better-auth/better-auth/commit/0b20f4a91c4ad56737f0a39faf2a764fe6363095) Merge branch 'main' into oidc-register - [`c268f4d`](https://github.com/better-auth/better-auth/commit/c268f4d4c3c8d737bc395125e1b8ef7a2a49d2f1) fix: merge conflicts - [`c819cce`](https://github.com/better-auth/better-auth/commit/c819cce0f642d81761107aabda2be4a8638fac74) docs: add changesets - [`66e0bc0`](https://github.com/better-auth/better-auth/commit/66e0bc0839cd94813c34b96314bba24250a75dd2) docs: ensure oauthApplication types match docs ### 📊 Changes **16 files changed** (+1793 additions, -1046 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/lazy-eels-peel.md` (+5 -0) ➕ `.changeset/smooth-masks-film.md` (+5 -0) ➕ `.changeset/tired-bananas-fetch.md` (+5 -0) 📝 `docs/content/docs/plugins/oidc-provider.mdx` (+173 -64) ➕ `packages/better-auth/src/oauth2.1/types.ts` (+12 -0) 📝 `packages/better-auth/src/plugins/jwt/index.ts` (+8 -0) 📝 `packages/better-auth/src/plugins/mcp/authorize.ts` (+10 -8) 📝 `packages/better-auth/src/plugins/mcp/index.ts` (+78 -148) 📝 `packages/better-auth/src/plugins/mcp/mcp.test.ts` (+96 -134) 📝 `packages/better-auth/src/plugins/oidc-provider/authorize.ts` (+5 -9) 📝 `packages/better-auth/src/plugins/oidc-provider/index.ts` (+196 -347) 📝 `packages/better-auth/src/plugins/oidc-provider/oidc.test.ts` (+260 -261) ➕ `packages/better-auth/src/plugins/oidc-provider/register.test.ts` (+286 -0) ➕ `packages/better-auth/src/plugins/oidc-provider/register.ts` (+390 -0) 📝 `packages/better-auth/src/plugins/oidc-provider/schema.ts` (+77 -13) 📝 `packages/better-auth/src/plugins/oidc-provider/types.ts` (+187 -62) </details> ### 📄 Description feat: additional registration endpoint unit tests feat: `clientRegistrationDefaultScopes` and `clientRegistrationAllowedScopes` specifies default and allowed scopes during registration fix: removes invalid grant types from being added into the application: "implicit" & "password" should be deprecated by security recommendations, "urn:ietf:params:oauth:grant-type:jwt-bearer" & "urn:ietf:params:oauth:grant-type:saml2-bearer" are unimplemented. chore: registration endpoint code for mcp and oidc plugins are now shared **Partial #3458** --- <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Improved OAuth client registration by externalizing the register endpoint, adding support for unauthenticated registration, and updating scope handling. Removed deprecated and unimplemented grant types. - **New Features** - Shared registration endpoint for OIDC and MCP plugins. - Added `allowUnauthenticatedClientRegistration` flag. - Introduced `clientRegistrationDefaultScopes` and `clientRegistrationAllowedScopes` for better scope control. - **Bug Fixes** - Removed unsupported grant types ("implicit", "password", "jwt-bearer", "saml2-bearer"). - Added and updated unit tests for registration. <!-- 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 20:35:26 -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#21772