將瀏覽器設定為使用 Windows 整合式驗證 (WIA) 搭配 AD FS

根據預設,在 Windows Server 2012 R2 的 Active Directory 同盟服務 (AD FS) 中會針對驗證要求啟用 Windows 整合式驗證 (WIA),而這些驗證要求會在組織內部網路內由於使用瀏覽器進行驗證的任何應用程式而發生。

AD FS 2016 現在具有已改善的預設設定,可讓 Edge 瀏覽器執行 WIA,同時也不會 (錯誤地) 攔截 Windows Phone:

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

上述表示您不再需要設定個別的使用者代理程式字串,來支援常見的 Edge 案例,即使其經常更新也一樣。

對於其他瀏覽器,請設定 AD FS 屬性 WiaSupportedUserAgents,以根據您使用的瀏覽器新增所需的值。 您可以使用下列程序。

檢視 WIASupportedUserAgent 設定

WIASupportedUserAgents 會定義支援 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 使用案例:

使用者代理程式 使用案例
MSIE 6.0 IE 6.0
MSIE 7.0;Windows NT IE 7,內部網路區域中的 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 Information Protection and Control 用戶端
Windows Rights Management 用戶端 Windows Rights Management 用戶端

Microsoft Edge 文件