Google身份验证Asp.net核心版

问题描述 投票:0回答:1

当我尝试在我的网络应用上使用Google登录时,我收到以下错误。它在使用localhost时工作正常

找不到此pelusoftcamerawebapp.azurewebsites.net页面没有找到网页的网页:https://pelusoftcamerawebapp.azurewebsites.net/signin-google?state=CfDJ8BRnSyuVZrdLjm6frrOu1DBgXqvK5dey3eI632SEKrS7vg ........

谷歌登录代码:

        [HttpGet]
        [Route("google-login")]
        public IActionResult GoogleLogin(string returnUrl = null)
        {
            var authProperties = new Microsoft.AspNetCore.Authentication.AuthenticationProperties
            {
                RedirectUri = string.IsNullOrEmpty(returnUrl) ? "account/profile" : returnUrl,
                IsPersistent = true
            };

            return Challenge(authProperties, new string[] { "google" });
        }

我已将pelusoftcamerawebapp.azurewebsites.net添加到谷歌控制台域验证中

你有什么主意吗?

asp.net asp.net-mvc google-authentication
1个回答
0
投票

由于Google已关闭Google Plus,因此基于Google Plus的身份验证机制已更改,并且还影响了ASP.NET和ASP.NET Core中现有的Google身份验证。

Microsoft已更新ASP.NET和ASP.NET Core的Google身份验证库。

以下是更多细节:Google+ based auth deprecation and replacement

© www.soinside.com 2019 - 2024. All rights reserved.