gpt4 book ai didi

oauth - MVC5 上的 Google OAuth ExternalLoginCallback?error=access_denied

转载 作者:行者123 更新时间:2023-12-03 21:16:49 34 4
gpt4 key购买 nike

我已经设置了我的 Google OAuth

enter image description here

我已将代码添加到 Startup.Auth.cs

 app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
{
// LRC
ClientId = "xxxxxxxxx",
ClientSecret = "xxxxx"
//CallbackPath = new PathString("/signin-google")
});

但是在我选择谷歌账户登录后,它再次将我重定向到登录页面,

我通过Chrome检查了网络,发现访问被拒绝。

http://www.liferunningclub.com.au/Account/ExternalLoginCallback?error=access_denied



我想不明白。

更新
现在我做了别的事情:
  • 我在帐户 Controller 上添加了一个注释 ([RequireHttps])
  • 我为我的项目启用了 SSL。
  • 我将 Google Console 中的 url 和重定向 url 更新为 https

  • 尝试使用 Google 登录,在我选择 Google 帐户后,它返回相同的 access_denied。

    如果谷歌的回复能提供更详细的信息就更好了。

    最佳答案

    我在使用最新的 ASP.Net MVC 模板并选择了“个人帐户”时遇到了同样的问题。

    解决方案是在 Google Developer Console 中为我的项目启用 Google+ API。

    我找到了答案 here (向下滚动到“Google OAuth 2.0 的更改...”)。

    关于oauth - MVC5 上的 Google OAuth ExternalLoginCallback?error=access_denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30221701/

    34 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com