0

When I try to add Google login in my ASP.NET MVC app, follow this resource:

https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/google-logins?view=aspnetcore-6.0 https://developers.google.com/identity/sign-in/web/sign-in

I get an error:

Error 400: redirect_uri_mismatch

You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy. \n\nIf you're the app developer, register the redirect URI in the Google Cloud Console.

Learn more
Request Details

The content in this section has been provided by the app developer. This content has not been reviewed or verified by Google.
If you're the app developer, make sure that these request details comply with Google policies.
redirect_uri=https://localhost:7082/

How should I fix this?

Thanks

5
  • 1
    Look at the second line of the error message you posted, it tells you what to do. Commented May 19, 2022 at 21:52
  • seems right but i dont know how it doesnt comply, i follow the guide step by step Commented May 19, 2022 at 22:40
  • Did you do this "register the redirect URI in the Google Cloud Console." for this redirect_uri=localhost:7082? Sorry I can't help more on how to do it as I haven't used Google Cloud only Azure. Commented May 20, 2022 at 13:12
  • do you mean this section in credentials at Google Cloud Platform? "Authorized redirect URLs: " Commented May 20, 2022 at 15:02
  • that sounds like it. Commented May 20, 2022 at 17:19

1 Answer 1

0

I'm using Google OAuth for my website. Same error here, It returns an error even though I correctly input my URI to google URI to my Project I input http://localhost/glogin/app/welcome.php and still not working but I just solved it when I added a second URI http://localhost/glogin/app/example.php I don't know what's the problem but it just solved my error and fixed it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.