![](/img/trans.png)
[英]Error - 403 Forbidden - Microsoft-Azure-Application-Gateway/v2
[英]ASP.NET MVC error 403 forbidden Microsoft-Azure-Application-Gateway/v2
我按照 Microsoft 的本教程将 Microsoft 登录添加到我的项目中 - .NET 4.7.2 上的 ASP.NET MVC。
我管理登录到我的 Microsoft 帐户访问主页。 但是,当我尝试注销并再次重新登录时,它没有到达主页,而是抛出 403 禁止 Microsoft-Azure-Application-Gateway/v2。 我试图删除历史记录并关闭页面,并且能够登录,但是当我尝试第二次尝试时,我会再次遇到同样的错误。
我检查了 cookie 历史记录,似乎这个 cookie .AspNet.Cookies
导致了问题。 当我尝试删除.AspNet.Cookies
时,我可以访问该页面而不会出现任何错误。
我尝试从本 教程中实现SameSiteCookieManager
类并添加到我的startup.cs
中,希望它会有所帮助,但我没有运气。
public void Configuration(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = CookieAuthenticationDefaults.AuthenticationType,
LoginPath = new PathString("/Home/Login"),
CookieSameSite = SameSiteMode.Lax,
CookieManager = new SameSiteCookieManager(new SystemWebCookieManager())
});
}
谁能指出这里的问题是什么? 我已经为此苦苦挣扎了将近 2 周。 非常感谢这里的任何帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.