Google Sign-In fails with redirect_uri_mismatch when using custom domain

I’m facing an issue when trying to use Google Sign-In with Auth0 + custom domain (auth.whosserver.com). Everything works fine with username/password login, but as soon as I try Google login, I get the following error:

Error 400: redirect_uri_mismatch

I’m developing locally using Vite at http://localhost:5173. In my Auth0 application settings, I’ve set the callback URL to:
http://localhost:5173/callback

This exact redirect URI is also added in the Google Cloud Console under my OAuth 2.0 Client ID settings as an Authorized redirect URI.

Despite this, I still get the same error. I’ve tried other variants as well, such as:

  • https://auth.whosserver.com/callback
  • https://auth.whosserver.com/login/callback
  • http://localhost:5173

Hi @younes048,

Welcome to the Auth0 Community!

As mentioned in our documentation regarding custom domains, when you are using them with other features such as the social IdPs, you will need to configure the IdPs Authorized Redirect URIs to include https://<YOUR-CUSTOM-DOMAIN>/login/callback. Make sure that you are not using Auth0 Developer Keys once you have set up the custom domain.

I believe this should solve this, and if you have further inquires please let me know.
Kind regards,
Remus