400. That’s an error. Error: redirect_uri_mismatch - Google OAuth Authentication

I have registered my website on google's Oauth login using MVC C# , but when trying to login using Google, i am getting this issue

400. That’s an error. Error: redirect_uri_mismatch

Although i have updated my Authorized redirect URIs using https://console.cloud.google.com/apis/credentials?project=project_name but it didn't worked for me

Not sure what is wrong

Asked by:- bhanu
: 671 At:- 5/10/2017 11:46:48 AM
google-Oauth-2 MVC C#

2 Answers
profileImage Answered by:- vikas_jk

If you have eneterd correct details in https://console.cloud.google.com/apis/credentials?project=project_name , then wait for few minutes as sometime's it take time to update the details.

Also please double check your url in google console, it must be

At:- 5/10/2017 11:54:44 AM
Yes it works after waiting for some time 0
By : bhanu - at :- 5/10/2017 3:18:05 PM
thanks for accepting my answer and upvoting, happy to help 0
By : vikas_jk - at :- 9/4/2017 7:34:53 AM

profileImage Answered by:- jaya

Above answer may not work for all users so few points to consider about this issue

  1. If you're using Google+ javascript button, then you have to use postmessage instead of the actual URI,aslo you need to specify this in 2 places (if you are using the web-app-server-flow). One is in the g-signin button on the javascript. The other is in the signet authorization client in your server code.
  2. Make sure to check the protocol "http://" or "https://" as google checks protocol as well.
  3. Using trailing slash (http://example.com/) in Authorized Redirect URIs and not using trailing slash (http://example.com) as actual URL, or vice-versa
  4. Error may also occur if actual site has www and on google cloud console it is registered without www
At:- 9/12/2017 3:35:40 PM Updated at:- 9/12/2017 3:36:02 PM

Login/Register to answer
Register directly by posting answer/details

Full Name *

Email *

By posting your answer you agree on privacy policy & terms of use