Add callbackUrl option to OAuth provider config
โ๏ธ Reasoning
This adds a callbackUrl option to OAuth provider configuration.
Currently, the OAuth callback URL is inferred from the host from which a user is attempting to sign in. This is problematic for situations like those encountered when using preview deployments on Vercel. If one can't use wildcard characters in a provider's callback URL config, or if one can't create new callback URLs via an API, new callback URLs must be added in a provider's UI for every single preview deployment.
This can be worked around by using a middleman proxy app. So, I could set my callback URL to https://www.authproxy.dev/redirect, and tell Authproxy to redirect to my preview deployment URL which is much easier than setting a new callback URL in an OAuth provider's developer portal.
With this PR, I can set callbackUrl to Authproxy (or a similar service) and remove a great deal of tedium from working with OAuth providers and Vercel preview deployments.
๐งข Checklist
- [x] Documentation The documentation on callback URLs is a bit confusing (because the term is used to mean two different things in different places), so I could use some help determining whether new documentation is needed here.
- [x] Tests As far as I can tell, there are none for this sort of option
- [x] Ready to be merged
๐ซ Affected issues
Please scout and link issues that might be solved by this PR.
Fixes: INSERT_ISSUE_LINK_HERE
๐ Resources
- Contributing guidelines
- Code of conduct
- Contributing to Open Source
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
| Name | Status | Preview | Comments | Updated |
|---|---|---|---|---|
| auth-docs | โ Failed (Inspect) | Jan 27, 2023 at 4:02AM (UTC) | ||
| next-auth-docs | ๐ Building (Inspect) | Jan 27, 2023 at 4:02AM (UTC) |
1 Ignored Deployment
| Name | Status | Preview | Comments | Updated |
|---|---|---|---|---|
| next-auth | โฌ๏ธ Ignored (Inspect) | Jan 27, 2023 at 4:02AM (UTC) |
Hi @jclem I moved the changes under /core in a new PR & will add you as co-author when merge, let's continue here ๐