首先,当尝试从元数据 URL 导入 RP 时:
我收到此错误:
An error occured during an attempt to read the federation metadata. Verify that the specified URL or hostname is a valid federation metadata endpoint.
...
Error message: The underlying connection was closed: An unexpected error occured on a send.
Run Code Online (Sandbox Code Playgroud)
事实证明,该问题是由于 Windows Server 至少到 2016 年为止都在使用 .NET Framework 的 TLS 1.0(其中实现了 ADFS 配置向导),而我的托管元数据文档的服务仅允许 TLS 1.2 作为最低配置版本:
从安全角度来看,将最低版本降至 TLS 1.0 是不行的,因此正确的解决方法是启用 TLS 1.2 作为ADFS 服务器上的默认版本。
这可以解决问题(我通过测试证实了这一点),但随后一些仅支持 TLS 1.0 的其他 RP 将停止工作,因此我不得不放弃直接从 URL 导入元数据并使用文件导入选项:
在这种情况下,又弹出了另一个错误,它恰好是:
An error occured during an attempt to read the federation metadata. Verify that the specified URL or hostname is a valid federation metadata endpoint.
...
Error message: Entity descriptor '...'. ID6018: Digest verification failed for reference '...'.
Run Code Online (Sandbox Code Playgroud)
事实证明,这是我在使用换行符和制表符格式化元数据文件中的 XML 时造成的,以提高可读性 - 最初全部都在一行上。ADFS 不允许这样做,因此文档必须与来自元数据端点的文档完全相同。
同一问题可能会导致不同的错误消息和代码,具体取决于 Windows 和 ADFS 版本。例如,这也可能是由元数据完整性检查失败引起的:
An error occured during an attempt to read the federation metadata. Verify that the specified URL or hostname is a valid federation metadata endpoint.
...
Error message: Entity descriptor '...'. ID6013: The signature verification failed.
Run Code Online (Sandbox Code Playgroud)
成功导入原始元数据文件并添加合适的索赔发行策略后,我终于可以正常工作了:
| 归档时间: |
|
| 查看次数: |
7408 次 |
| 最近记录: |