[PR #6021] [MERGED] docs: clarify that the redirectURI must include providerId parameter in generic oauth #23290

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6021
Author: @IdrisGit
Created: 11/16/2025
Status: Merged
Merged: 4/9/2026
Merged by: @ping-maxwell

Base: mainHead: docs/generic-oauth-providerId-shoud-match-in-redirectURI


📝 Commits (3)

  • 19829a8 docs(generic-oauth): update docs to clarify that in generic oauth the redirect-uri must have providerId as the last param
  • c5ae2c1 docs(generic-oauth): make clarification more concise
  • a90e261 Merge branch 'main' into docs/generic-oauth-providerId-shoud-match-in-redirectURI

📊 Changes

1 file changed (+3 additions, -1 deletions)

View changed files

📝 docs/content/docs/plugins/generic-oauth.mdx (+3 -1)

📄 Description

We encountered this issue when someone in the team changed the redirect URI for a Generic OAuth provider to /api/auth/callback/microsoft. Even though the client was sending the correct providerId, the plugin was looking for a provider named "microsoft" in the Generic OAuth config and throwing "No config found for provider microsoft".

It took me 4 hours to figure this out after digging into the source code, since this requirement wasn't clear from the existing documentation. The problem was that Generic OAuth needs the :providerId parameter in the redirect URL path to route to the right provider configuration, unlike built-in social providers that have predefined URLs.

This should help prevent similar configuration headaches when setting up custom OAuth providers.

Open to any suggestions on improving the language or clarity!


Summary by cubic

Clarified Generic OAuth docs: the callback/redirect URI must include the :providerId placeholder (e.g., /api/auth/oauth2/callback/my-provider) and it must match your configured provider ID; unlike built-in providers, this is required to route to the right config. Updated the callback route explanation and the redirectURI option to prevent “No config found for provider …” errors.

Written for commit a90e261f95. Summary will update 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/6021 **Author:** [@IdrisGit](https://github.com/IdrisGit) **Created:** 11/16/2025 **Status:** ✅ Merged **Merged:** 4/9/2026 **Merged by:** [@ping-maxwell](https://github.com/ping-maxwell) **Base:** `main` ← **Head:** `docs/generic-oauth-providerId-shoud-match-in-redirectURI` --- ### 📝 Commits (3) - [`19829a8`](https://github.com/better-auth/better-auth/commit/19829a8eba735f6c3184c40f7db203b38ff833c0) docs(generic-oauth): update docs to clarify that in generic oauth the redirect-uri must have providerId as the last param - [`c5ae2c1`](https://github.com/better-auth/better-auth/commit/c5ae2c1b552d61e93471fd5d7ab8539f3a2c1c5b) docs(generic-oauth): make clarification more concise - [`a90e261`](https://github.com/better-auth/better-auth/commit/a90e261f955a0cf722fada403d92b3bf8ccc9151) Merge branch 'main' into docs/generic-oauth-providerId-shoud-match-in-redirectURI ### 📊 Changes **1 file changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/generic-oauth.mdx` (+3 -1) </details> ### 📄 Description We encountered this issue when someone in the team changed the redirect URI for a Generic OAuth provider to `/api/auth/callback/microsoft`. Even though the client was sending the correct `providerId`, the plugin was looking for a provider named "microsoft" in the Generic OAuth config and throwing "No config found for provider microsoft". It took me 4 hours to figure this out after digging into the source code, since this requirement wasn't clear from the existing documentation. The problem was that Generic OAuth needs the `:providerId` parameter in the redirect URL path to route to the right provider configuration, unlike built-in social providers that have predefined URLs. This should help prevent similar configuration headaches when setting up custom OAuth providers. Open to any suggestions on improving the language or clarity! <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Clarified Generic OAuth docs: the callback/redirect URI must include the `:providerId` placeholder (e.g., `/api/auth/oauth2/callback/my-provider`) and it must match your configured provider ID; unlike built-in providers, this is required to route to the right config. Updated the callback route explanation and the `redirectURI` option to prevent “No config found for provider …” errors. <sup>Written for commit a90e261f955a0cf722fada403d92b3bf8ccc9151. Summary will update 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:36:21 -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#23290