[英]ASP.NET MVC error 403 forbidden Microsoft-Azure-Application-Gateway/v2
I follow this tutorial from Microsoft to add Microsoft sign in into my project - ASP.NET MVC on .NET 4.7.2.我按照 Microsoft 的本教程将 Microsoft 登录添加到我的项目中 - .NET 4.7.2 上的 ASP.NET MVC。
I managed login into my Microsoft account access the main page.我管理登录到我的 Microsoft 帐户访问主页。 However, when I tried to logout and re-login again, instead of reaching the main page, it throws 403 forbidden Microsoft-Azure-Application-Gateway/v2.
但是,当我尝试注销并再次重新登录时,它没有到达主页,而是抛出 403 禁止 Microsoft-Azure-Application-Gateway/v2。 I tried to delete the history and close the page, and able to login, but when I tried the 2nd attempt I will get the same error again.
我试图删除历史记录并关闭页面,并且能够登录,但是当我尝试第二次尝试时,我会再次遇到同样的错误。
I checked the cookies history and seems like this cookie .AspNet.Cookies
is causing the problem.我检查了 cookie 历史记录,似乎这个 cookie
.AspNet.Cookies
导致了问题。 When I tried to remove .AspNet.Cookies
, I'm able to access the page without any error.当我尝试删除
.AspNet.Cookies
时,我可以访问该页面而不会出现任何错误。
I tried to implement SameSiteCookieManager
class from this tutorial and added into my startup.cs
with hopes that it will help, but I have no luck with that.我尝试从本 教程中实现
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())
});
}
Can anyone pointed out what is the issue here?谁能指出这里的问题是什么? I have been struggling with this for almost 2 weeks.
我已经为此苦苦挣扎了将近 2 周。 Really appreciate any kind of help here.
非常感谢这里的任何帮助。
ASP.NET MVC error 403 forbidden Microsoft-Azure-Application-Gateway/v2
ASP.NET MVC 错误 403 禁止 Microsoft-Azure-Application-Gateway/v2
Azure Active Directory
Azure Active Directory
中的一些设置,我已经按照给定的文档进行了登录、注销和重新登录,没有任何问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.