[PR #6412] [CLOSED] Feat: OIDC provider wildcard redirect URI #6647

Closed
opened 2026-03-13 13:06:41 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6412
Author: @elmdecoste
Created: 11/29/2025
Status: Closed

Base: canaryHead: feat/oidc-provider-wildcard-redirecturi


📝 Commits (3)

  • 9afebfa feat(oidc-provider): Added wildcard redirect URI support
  • aa6455a docs: Added wildcard domain updates to the documentation
  • 9488ce3 chore: Fixed lint issue

📊 Changes

7 files changed (+788 additions, -6 deletions)

View changed files

📝 docs/content/docs/plugins/oidc-provider.mdx (+9 -1)
📝 packages/better-auth/src/plugins/oidc-provider/authorize.ts (+14 -3)
📝 packages/better-auth/src/plugins/oidc-provider/index.ts (+5 -2)
📝 packages/better-auth/src/plugins/oidc-provider/oidc.test.ts (+429 -0)
📝 packages/better-auth/src/plugins/oidc-provider/utils.ts (+2 -0)
packages/better-auth/src/plugins/oidc-provider/utils/redirect-uri.test.ts (+260 -0)
packages/better-auth/src/plugins/oidc-provider/utils/redirect-uri.ts (+69 -0)

📄 Description

Added the ability to provide wildcards into the domain section of the redirect URIs for the OIDC provider plugin. This change makes it much simpler to work with preview environments and enterprise use cases where there are multiple domains that you want to allow within the OIDC flow but can't reasonably add in every variation of domain.


Summary by cubic

Adds wildcard support for redirect URIs in the OIDC provider, enabling patterns like https://*.example.com/callback. This simplifies preview envs and multi-domain enterprise setups while keeping validation strict.

  • New Features
    • Wildcard matching in the host of redirect_uris for authorize, token exchange, and logout.
    • Strict checks: protocol and port must match (defaults normalized), path/query must be exact; only host can use a wildcard.
    • New matchesRedirectURI utility with docs updates and comprehensive tests.

Written for commit 9488ce3cfd. 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/6412 **Author:** [@elmdecoste](https://github.com/elmdecoste) **Created:** 11/29/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `feat/oidc-provider-wildcard-redirecturi` --- ### 📝 Commits (3) - [`9afebfa`](https://github.com/better-auth/better-auth/commit/9afebfa7414b9c4558fec805463f126ac5f17d25) feat(oidc-provider): Added wildcard redirect URI support - [`aa6455a`](https://github.com/better-auth/better-auth/commit/aa6455a235c11875d9cca1a29f32fc82df4b6621) docs: Added wildcard domain updates to the documentation - [`9488ce3`](https://github.com/better-auth/better-auth/commit/9488ce3cfd6006efa936aba32cb1caf7d7314f66) chore: Fixed lint issue ### 📊 Changes **7 files changed** (+788 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/oidc-provider.mdx` (+9 -1) 📝 `packages/better-auth/src/plugins/oidc-provider/authorize.ts` (+14 -3) 📝 `packages/better-auth/src/plugins/oidc-provider/index.ts` (+5 -2) 📝 `packages/better-auth/src/plugins/oidc-provider/oidc.test.ts` (+429 -0) 📝 `packages/better-auth/src/plugins/oidc-provider/utils.ts` (+2 -0) ➕ `packages/better-auth/src/plugins/oidc-provider/utils/redirect-uri.test.ts` (+260 -0) ➕ `packages/better-auth/src/plugins/oidc-provider/utils/redirect-uri.ts` (+69 -0) </details> ### 📄 Description Added the ability to provide wildcards into the domain section of the redirect URIs for the OIDC provider plugin. This change makes it much simpler to work with preview environments and enterprise use cases where there are multiple domains that you want to allow within the OIDC flow but can't reasonably add in every variation of domain. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds wildcard support for redirect URIs in the OIDC provider, enabling patterns like https://*.example.com/callback. This simplifies preview envs and multi-domain enterprise setups while keeping validation strict. - **New Features** - Wildcard matching in the host of redirect_uris for authorize, token exchange, and logout. - Strict checks: protocol and port must match (defaults normalized), path/query must be exact; only host can use a wildcard. - New matchesRedirectURI utility with docs updates and comprehensive tests. <sup>Written for commit 9488ce3cfd6006efa936aba32cb1caf7d7314f66. 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-03-13 13:06: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#6647