How do you fix Error 400: redirect_uri_mismatch? This error generally appears if you’ve not registered an ‘Authorized redirect URI’ where the response is returned or registered incorrectly in the APIs console.
This article will explain “error 400: redirect_uri_mismatch” and present three applicable methods to fix it.
What is “400: redirect_uri_mismatch”?
The “400: redirect_uri_mismatch” error occurs when adding the Client ID and Secret to SSA at the end of the process. Typically this error is related to the URL of your website needing to be entered correctly in the API console about the newly created Client ID and Secret.
It is a problem with the URL and not your fault; Google is very particular about URLs. A trailing slash can cause this issue.
How to Fix 400 Redirect_uri_mismatch?
This error typically occurs when you do not have an authorized redirect URI registered on the APIs Console or if you have registered an incorrect redirect URI in the APIs Console. This section will present three methods to fix the error 400: redirect_uri_mismatch in WordPress.
Method 1: Enter Authorized redirect URIs
Follow these steps to fix Google OAuth 400 redirect_uri_mismatch by entering an authorized redirect URIs:
- Go to the API Console.
- Check the top-left corner and select the correct project.
- Go to APIs and Services and click on Credentials.
- Click on the OAuth Client Id you created.
- Go to the Authorized redirect URIs section.
- Click on the Add URI button and add your authorized redirect URI.
Try the next method if this method does not work to fix the Google redirect_uri_mismatch error.
Method 2: Adding the URL from the Error Message
Adding the URL from the error message is another method to fix the “400: redirect_uri_mismatch” error. Follow these steps to use this method:
- Add the exact URL you see in this error message.
- Select Save and try again.
If this does not help, please consider testing out a variety of URLs as the next method.
Method 3: Entering a Variety of URLs
As we mentioned above, Google is quite picky regarding URLs. A trailing slash may cause this error.
Therefore, follow these steps to use this method:
- Enter various URLs into the Authorized Redirect URIs section. You are welcome to include every version of your URL under the Authorized Redirect URIs section. Enter the following URLs:
- Trailing slash vs. no trailing slash:
https://yoursite.com/
https://yoursite.com
- www vs. no www:
https://www.yoursite.com
https://yoursite.com
- Click on the Save button and try again when you’re done adding the variety of URIs from above.
Conclusion
Throughout this article, we have explored what “400 redirect_uri_mismatch” is and presented three possible solutions to fix this problem.
Thanks for taking the time to read this article. In the comments section, you may post your comments or questions.
Following us on Facebook and Twitter will ensure that you are kept up to date on our articles.