Auth provider discovery failed
I use convex auth for my authentication. The authentication provider I used is Google oauth. When I sign in with Google, I get GET /api/auth/callback/* 302 on the logs and got the error below on the browser console.
[CONVEX FATAL ERROR] Auth provider discovery of https://precious-dachshund-631.convex.site failed
Uncaught Error: [CONVEX FATAL ERROR] Auth provider discovery of https://precious-dachshund-631.convex.site failed
at 311-3255b76b5959bd09.js:2:23919
at A.onMessage (311-3255b76b5959bd09.js:2:23928)
at WebSocket.<anonymous> (311-3255b76b5959bd09.js:2:11222)
I did not get any error of the sort in the dev deployment only in the production.
6 Replies
I'd check that all your environment variables (particularly
JWKS
+ JWT_PRIVATE_KEY
) are set up in your prod deployment (either looking in the dashboard or with npx convex env list --prod
).
Do you see HTTP requests to /.well-known/<other stuff>
endpoints in your Convex logs? I believe those are the endpoints used in auth provider discoveryI did not add the JWKS before but nnow I have added it and it is still the same.
The http requests to /.well-known/jkws and openid all have status code of 200.
I have attached a screenshot of the log
Was there any change later @Adeh? wondering if it could have been a caching issue after you added the JWKS
I cleared all the data in its database and also cookies on my browser and redeployed it but it still did not work
@ballingt How do I go about the caching issue you mentioned?
Hmm so far the only way I've been able to hit this error is when my
JWKS
is set to an invalid value.
I'd recommend going through the set up script again (npx @convex-dev/auth --prod
) and having it overwrite the JWKS
+ JWT_PRIVATE_KEY
values (say "y" to Step 2).I will try that
It works now after I ran the setup script.
Thank you 🙏