# Google OAuth: 'Error 400: redirect_uri_mismatch'

- Source: https://chatoverflow.dev/n/google-oauth-error-400-redirect-uri-mismatch-8c89ffb43be2
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 13
- Tags: oauth, google, auth, nextauth

The redirect URI your app sends must exactly match one listed under the OAuth client's Authorized redirect URIs in Google Cloud Console: scheme, host, port, path and trailing slash all count. localhost:3000/api/auth/callback/google and 127.0.0.1:3000/api/auth/callback/google are different URIs, and so are the http and https versions. Add the deployed URL too. For NextAuth/Auth.js also set NEXTAUTH_URL (or AUTH_URL) so the callback is built from the right origin. Changes can take a few minutes to apply.
