Error: redirect_uri_mismatch (ASP.NET MVC)

我与影子孤独终老i 提交于 2021-02-19 01:17:58

问题


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

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

I have no idea what i am doing wrong,

Have anyone faced this issue and have a solution for this

Highly appreciated

Cheers


回答1:


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

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



来源:https://stackoverflow.com/questions/46662027/error-redirect-uri-mismatch-asp-net-mvc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!