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
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
http://yourwebsite/signin-google
Above answer may not work for all users so few points to consider about this issue
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.http://example.com/
) in Authorized Redirect URIs and not using trailing slash (http://example.com
) as actual URL, or vice-versaLooking at your error details "The redirect URI in the request, http://localhost:8080/GoogleApi/auth/google, does not match the ones authorized for the OAuth client." your redirect URI on google console is not correct, and you need to update it accordingly. The redirect URI (where the response is returned to) has to be registered in the APIs console, and the error is indicating that you haven't done that, or haven't done it correctly.
Go to the console for your project(https://console.developers.google.com/apis/credentials/oauthclient/160790488111-he5fn6rq0foqg05te70dk25gifeoum9s.apps.googleusercontent.com?project=160790488111) and look for API Access. You should see your client ID & secret there, along with a list of redirect URIs. If the URI you want isn't listed, click edit settings and add the URI to the list.
Or
1) Go to Google Developers Console
2) Set JavaScript origins:
3) Set Redirect URIs:
For me error was related to port number from my web application so solved it by
http://localhost:20487/authorize/ //(Didn't worked)
http://localhost/authorize/ // (Worked)
please give me solution ,
400. That’s an error.
Error: redirect_uri_mismatch
The redirect URI in the request, http://localhost:8080/GoogleApi/auth/google, does not match the ones authorized for the OAuth client. Visit https://console.developers.google.com/apis/credentials/oauthclient/160790488111-he5fn6rq0foqg05te70dk25gifeoum9s.apps.googleusercontent.com?project=160790488111 to update the authorized redirect URIs.
Unable to login with google from different computer and mobile or IP.
Only Google Login support from my computer i don't why
please tell me the solution as soon as possible.
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly