Ali
Ali

Reputation: 2768

Error: redirect_uri_mismatch (ASP.NET MVC)

I am getting the following error when trying to let user login using GOOGLE

enter image description here

I have tried so many things and nothing works

I used the following code initially

app.UseGoogleAuthentication(clientId: "APIKEY.apps.googleusercontent.com",
            clientSecret: "SECRET-K");

I also tried the following

app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
            {
                ClientId = "APIKEY.apps.googleusercontent.com",
                ClientSecret = "SECRET-K",
                CallbackPath = new PathString("/signin-google")
            });

No luck at all,

My Client ID for Web application is set up as following enter image description here

I have no idea what i am doing wrong,

Have anyone faced this issue and have a solution for this

Highly appreciated

Cheers

Upvotes: 6

Views: 1314

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117331

Google developer console remove the / at the end of your redirect URI.

Redirect URI must match exactly the location you are sending it from.

Upvotes: 1

Related Questions