简体   繁体   English

使用 Azure AD 的 C# MVC Web App 在失败之前随机开始重定向大约 10 次

[英]C# MVC Web App using Azure AD randomly started redirecting about 10 times before failing

I wrote a web app for internal use in my company and it has not had a problem in the few months it's been live.我编写了一个 Web 应用程序供公司内部使用,并且在它上线的几个月内没有出现问题。 On Friday, folks said they could no longer login any longer.周五,人们说他们不能再登录了。 Nothing in the code changed apart from some javascript.除了一些 javascript 之外,代码中没有任何变化。 Nothing in Azure seemingly changed. Azure 中似乎没有任何变化。

Here's what happens: I go through the normal procedure of entering my credentials, then I get redirected to the company's 2FA stuff.发生的事情是这样的:我按照正常程序输入我的凭据,然后我被重定向到公司的 2FA 内容。 Once I pass that, it asks me if I want to stay logged in. From there, I can watch the URL in my address bar change about 10 times before finally just giving the famous "We couldn't sign you in. Please try again."一旦我通过它,它会问我是否要保持登录状态。从那里,我可以看到地址栏中的 URL 更改了大约 10 次,最后只给出著名的“我们无法登录。请再试一次” .”

I am making sure to access the web app using HTTPS, btw.我确保使用 HTTPS 访问 Web 应用程序,顺便说一句。 Anonymous login is set in Azure. Azure 中设置了匿名登录。 I don't know what to do.我不知道该怎么办。 Any help is appreciated greatly!非常感谢任何帮助!

My boss figured it out late yesterday evening.我的老板昨天晚上很晚才知道。

added a rewrite rule to system.webServer向 system.webServer 添加了重写规则

 <rewrite> <outboundRules> <rule name="Add SameSite" preCondition="No SameSite"> <match serverVariable="RESPONSE_Set_Cookie" pattern=".*" negate="false" /> <action type="Rewrite" value="{R:0}; SameSite=none;" /> <conditions> </conditions> </rule> <preConditions> <preCondition name="No SameSite"> <add input="{RESPONSE_Set_Cookie}" pattern="." /> <add input="{RESPONSE_Set_Cookie}" pattern="; SameSite=none" negate="true" /> </preCondition> </preConditions> </outboundRules> </rewrite>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MVC Web 应用程序 - Azure AD 和外部帐户 - MVC Web App - Azure AD and External Account 使用 Azure AD 并在 C# Windows 应用程序中获取应用程序角色 - Using Azure AD and Getting App Role in C# Windows Application 使用C#创建Azure Web应用程序 - Create an Azure Web App Using C# C#MVC Web应用程序服务连接到Azure存储Blob - C# MVC Web App Service Connect to Azure Storage Blob 无法从MVC Web应用程序访问WebApi,其中两者都由Azure AD B2C保护 - Unable to access a WebApi from a MVC Web app where both are secured by Azure AD B2C MVC 5 C#Web App针对AD使用表单或Windows身份验证 - MVC 5 C# Web App use forms or windows authentication against AD 在创建视图MVC C#中提交之前在AD中检查名称 - Check name in AD before submit in create view MVC C# 如何使用 C# windows 表单应用程序为 windows 10、8 配置自组织网络 - How to configure ad hoc network using C# windows form app for windows 10, 8 如何在 C# MVC 中使用 Azure AD 实现注销后 - How to implement a post-logout with Azure AD in C# MVC Azure AD - 在 C# Web API 中使用来自 Angular SPA 的图 API 访问令牌 - Azure AD - Using Graph API access token from Angular SPA in C# Web API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM