Software⏱️ 2 min read📅 2026-05-31

How to Fix: Google OAuth 2 authorization - Error: redirect_uri_mismatch

Configure the redirect URI in Google OAuth 2 settings to match the actual URL where the callback will be received.

Quick Answer: Update the redirect URI in the Google OAuth 2 settings on the console to match the actual URL of your application, such as http://127.0.0.1:3000/auth/google_oauth2/callback.

To resolve the Google OAuth 2 authorization error 'redirect_uri_mismatch', it's essential to ensure that the redirect URI in your application matches the one registered in the Google API Console. This mismatch can occur due to a variety of reasons such as typos, incorrect domain names, or not including the full URL.

⚠️ Common Causes

  • Using a non-existent domain name or an incomplete URL.

🚀 How to Resolve This Issue

Method 1: Verify Redirect URI

  1. Step 1: Go to the Google API Console and navigate to your application's Credentials page.

Method 2: Update Redirect URI in Credentials Page

  1. Step 1: Select the 'OAuth client ID' for your application.
  2. Step 2: Click on the 'Edit' button next to 'Authorized Redirect URIs'.
  3. Step 3: Enter the correct redirect URI, which should match the one used in your application. For example, if your application is running on http://127.0.0.1:3000/auth/google_oauth2/callback, enter that URL exactly as it appears.

🎯 Final Words

After verifying and updating the redirect URI, try logging in with Google OAuth 2 authorization again. If you're still facing issues, ensure that your application is properly configured and that there are no other errors in your code.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions