在MVC 5应用程序中,我在Web.config中有这个:
<system.web>
<compilation debug="true" targetFramework="4.6.1" />
<httpRuntime targetFramework="4.6.1" />
<authentication mode="Windows" />
<authorization>
<deny users="?" />
<allow users="<list of authorized users>" />
</authorization>
</system.web>
应用程序正确地从指定列表中验证用户,但我的问题是它每次都要求刷新页面或导航到该页面。我想让它一次询问,然后记住用户在应用程序页面之间导航。我怎么能做到这一点?
据我所知,存储memebr for windows身份验证与IIS设置无关。这与浏览器设置有关。我想你可能会禁用浏览器自动提交Windows凭据。
对于IE或Chrome(Chrome浏览器使用使用Internet Explorer管理的系统设置):
注意:您应该在Intranet中添加URL,如下图所示:
1.通过菜单栏导航到工具 - > Internet选项 - >安全
2.选择本地Intranet并单击“自定义级别”按钮
3.滚动到窗口底部的“用户身份验证”部分,选择“仅在Intranet区域中自动登录”
对于Firefox:
1.启动Firefox
2.在地址栏中输入about:config。在警告提醒谨慎的提示下,同意继续。
3.加载配置页面后,在过滤器框中键入:network.automatic。你应该看到network.automatic-ntlm-auth.trusted-uris的搜索结果
4.双击行修改network.automatic-ntlm-auth.trusted-uris,然后输入https://your_SecureAuth_FQDN.com;可以通过逗号分隔多个站点来添加它们,如下例所示:https://your_SecureAuth_FQDN.com,https://www.replacewithyourintranetsite.com
5.单击“确定”并关闭Firefox