配置浏览器以将 Windows 集成身份验证 (WIA) 与 AD FS 配合使用

默认情况下,Windows Server 2012 R2 的 Active Directory 联合身份验证服务 (AD FS) 中已启用 Windows 集成身份验证 (WIA),用于在组织内部网络 (Intranet) 中为使用浏览器进行身份验证的任何应用程序发出的身份验证请求。

AD FS 2016 现在有一个改进的默认设置,使 Edge 浏览器能够执行 WIA,同时还不会(错误地)捕获 Windows Phone:

=~Windows\s*NT.*Edg.*

上述情况意味着你不再需要配置单个用户代理字符串来支持常见的 Edge 方案,即使它们经常更新。

For other browsers, configure the AD FS property WiaSupportedUserAgents to add the required values based on the browsers you are using. 可使用以下过程。

查看 WIASupportedUserAgent 设置

The WIASupportedUserAgents defines the user agents that support WIA. 在浏览器或浏览器控件中执行登录时,AD FS 会分析用户代理字符串。

可使用以下 PowerShell 示例查看当前设置:

Get-AdfsProperties | select -ExpandProperty WiaSupportedUserAgents

WIA Support

更改 WIASupportedUserAgent 设置

默认情况下,新的 AD FS 安装会创建一组用户代理字符串匹配项。 但是,由于浏览器和设备的变化,这些可能已过时。 特别是,Windows 设备具有类似的用户代理字符串,只是在令牌上略有不同。 以下 Windows PowerShell 示例为目前市场上支持无缝 WIA 的当前设备集提供了最佳指导:

如果你在 Windows Server 2012 R2 或更低版本上有 AD FS:

Set-AdfsProperties -WIASupportedUserAgents @("MSIE 6.0", "MSIE 7.0; Windows NT", "MSIE 8.0", "MSIE 9.0", "MSIE 10.0; Windows NT 6", "Windows NT 6.3; Trident/7.0", "Windows NT 6.3; Win64; x64; Trident/7.0", "Windows NT 6.3; WOW64; Trident/7.0", "Windows NT 6.2; Trident/7.0", "Windows NT 6.2; Win64; x64; Trident/7.0", "Windows NT 6.2; WOW64; Trident/7.0", "Windows NT 6.1; Trident/7.0", "Windows NT 6.1; Win64; x64; Trident/7.0", "Windows NT 6.1; WOW64; Trident/7.0","Windows NT 10.0; WOW64; Trident/7.0","MSIPC", "Windows Rights Management Client", "Edg/","Edge/")

如果你在 Windows Server 2016 或更高版本上有 AD FS:

Set-AdfsProperties -WIASupportedUserAgents @("MSIE 6.0", "MSIE 7.0; Windows NT", "MSIE 8.0", "MSIE 9.0", "MSIE 10.0; Windows NT 6", "Windows NT 6.3; Trident/7.0", "Windows NT 6.3; Win64; x64; Trident/7.0", "Windows NT 6.3; WOW64; Trident/7.0", "Windows NT 6.2; Trident/7.0", "Windows NT 6.2; Win64; x64; Trident/7.0", "Windows NT 6.2; WOW64; Trident/7.0", "Windows NT 6.1; Trident/7.0", "Windows NT 6.1; Win64; x64; Trident/7.0", "Windows NT 6.1; WOW64; Trident/7.0","Windows NT 10.0; WOW64; Trident/7.0", "MSIPC", "Windows Rights Management Client", "=~Windows\s*NT.*Edg.*")

上述命令将确保 AD FS 仅涵盖以下 WIA 用例:

User Agents Use cases
MSIE 6.0 IE 6.0
MSIE 7.0;Windows NT IE 7、Intranet 区域中的 IE。 “Windows NT”片段由桌面操作系统发送。
MSIE 8.0 IE 8.0(没有设备发送此内容,因此需要更具体的说明)
MSIE 9.0 IE 9.0(没有设备发送此内容,因此不需要更具体的说明)
MSIE 10.0;Windows NT 6 适用于 Windows XP 和更高版本的桌面操作系统的 IE 10.0

已排除 Windows Phone 8.0 设备(首选项设置为“移动”),因为它们会发送

用户代理:Mozilla/5.0(兼容;MSIE 10.0;Windows Phone 8.0;Trident/6.0;IEMobile/10.0;ARM;Touch;NOKIA;Lumia 920)
Windows NT 6.3;Trident/7.0

Windows NT 6.3;Win64;x64;Trident/7.0

Windows NT 6.3;WOW64;Trident/7.0
Windows 8.1 桌面操作系统,不同平台
Windows NT 6.2;Trident/7.0

Windows NT 6.2;Win64;x64;Trident/7.0

Windows NT 6.2;WOW64;Trident/7.0
Windows 8 桌面操作系统,不同平台
Windows NT 6.1;Trident/7.0

Windows NT 6.1;Win64;x64;Trident/7.0

Windows NT 6.1;WOW64;Trident/7.0
Windows 7 桌面操作系统,不同平台
Edg/ 和 Edge/ 适用于 Windows Server 2012 R2 或更低版本的 Microsoft Edge (Chromium)
=~Windows\s*NT.*Edg.* 适用于 Windows Server 2016 或更高版本的 Microsoft Edge (Chromium)
MSIPC Microsoft 信息保护和控制客户端
Windows Rights Management 客户端 Windows Rights Management 客户端

Microsoft Edge 文档