Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add callbackUrl option to OAuth provider config #5375

Closed
wants to merge 3 commits into from

Conversation

jclem
Copy link

@jclem jclem commented Sep 17, 2022

☕️ 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

  • 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.
  • Tests As far as I can tell, there are none for this sort of option
  • Ready to be merged

🎫 Affected issues

Please scout and link issues that might be solved by this PR.

Fixes: INSERT_ISSUE_LINK_HERE

📌 Resources

@vercel
Copy link

vercel bot commented Sep 17, 2022

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)

@github-actions github-actions bot added legacy Refers to `next-auth` v4. Minimal maintenance. and removed providers core Refers to `@auth/core` labels Jan 27, 2023
@ThangHuuVu
Copy link
Member

Hi @jclem I moved the changes under /core in a new PR & will add you as co-author when merge, let's continue here 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy Refers to `next-auth` v4. Minimal maintenance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants