Convext Auth + Vercel + Github: "The redirect_uri is not associated with this application"
I'm getting this redirect_url warning and I can't continue to sign in using github. Iv'e set the Github app redirect_uri to the convex prudction auth URL that ends with .site.
What am I'm missing?
6 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
It's working fine on localhost. I wonder why it will complain when hosting on Vercel.
I'd check your Github OAuth app's configuration (in the Github UI under Developer Settings). The Homepage URL should be the URL for your frontend (e.g.
https://my-cool-app.vercel.app
), and the Callback URL should be https://<your prod convex deployment>.convex.site/api/auth/callback/github
I don't think there's an easy way to have the same Github OAuth app configured for both dev and prod, so I recommend making a separate one for prod, and then setting the environment variables in Convex for AUTH_GITHUB_ID and AUTH_GITHUB_SECRET differently for prod (see https://labs.convex.dev/auth/config/oauth#production-setup)OAuth - Convex Auth
Authentication library for your Convex backend
Yes I have separate app for production with different ID and Secret. I tried exactly what you offered. I use my vercel.app url as my website url and the callback url (look below)
This is what I see in the logs (after sign-in = success).
GET https://mypublicurl-newt-611.convex.site/api/auth/signin/github?code=jsomecodehere - 302
Not sure what else to try.

Okay Iv'e fixed the issue, inside github I changed the callback to https://mypublicurl-newt-611.convex.site without the
/api/auth/
and it worked. I guess every sub-path of the callback url will work as redirect url. (probably had a typo when it was full but it's working now so I guess I'll leave it at that). Thanks a lot!when reading here I've tried to use .site instead of .cloud and now it's working (including the path fragments) ... so if anyone maybe also copy and pasted the URI from the dev env, just use https://foo.convex.site instead of https://foo.convex.cloud