2017-10-10 134 views
5

尝试使用GOOGLE错误:redirect_uri_mismatch(ASP.NET MVC)

enter image description here

让用户登录我已经尝试了这么多东西,没事的时候,我收到以下错误工作

我用下面的代码最初

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

我也试过以下

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

没有运气的话,

为Web应用我的客户ID被设置为以下 enter image description here

我不知道我做错了,

有任何人面对这个问题并有此解决方案

高度赞赏

Cheers

+3

在Google开发人员控制台中删除/位于重定向URI的末尾。可以帮助https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#web-applications-aspnet-mvc – DaImTo

+1

哇 - 这很有效,非常感谢你@DaIm我如何将这个问题标记为解答? – aliusman

+0

上周有人加了一个,最后你不是唯一这样做:) – DaImTo

回答

1

Google开发人员控制台在重定向URI的末尾删除/

重定向URI必须完全匹配您发送它的位置。