在 ADFS 3.0 中使用自定义 authentication/claims 提供程序实施 Office 365 单点登录(回复:AADSTS90019)

Implementing Office 365 single sign-on using custom authentication/claims provider in ADFS 3.0 (RE: AADSTS90019)

我在 ADFS 3.0 中成功配置了一个新的 Claims Provider Trust,它允许我们使用单独的 SAML IdP 并让 ADFS 3.0 成为 SP。当我们通过我们的 SAML IdP 时,我们现在看到 "You are signed in"。所以这部分工作正常(SSO 到 ADFS 3.0)。

但是,现在尝试访问 Office 365 应用 returns 在 https://login.microsoftonline.com/login.srf 处出现以下错误:

AADSTS90019: No tenant-identifying information found in either the request or implied by any provided credentials.

有什么想法吗?我是否需要添加依赖方信任以使 Office 365 也信任我们基于 SAML 的声明提供程序?

例如,尝试完成最后一步以完全 SSO-ed 到 Outlook Web App,感觉我只差几个参数了。

因此,要正确执行此操作(通过 ADFS 中的自定义 authentication/claims 提供程序 SSO 进入 Office 365),我们必须:

  1. 允许传入的名称 ID 声明。向 ADFS 中的新声明提供程序添加一个声明规则以传递名称 ID。
  2. 将名称 ID 映射到相应的 AD 用户。 添加一个 声明规则 到现有的 Microsoft Office 365 Identity Platform 依赖信任方使用名称 ID(根据需要格式化)和 return 所需字段查询 AD:UPNImmutableID.

新声明提供程序声明规则的原始示例:

c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] == "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"]
=> issue(claim = c);

使用Name ID查询AD的例子return UPNImmutableID:

c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] == "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"]
=> issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/claims/UPN", "http://schemas.microsoft.com/LiveID/Federation/2008/05/ImmutableID"), query = "samAccountName={0};userPrincipalName,objectGUID;DOMAIN\{1}", param = regexreplace(c.Value, "(?<domain>[^\]+)\(?<user>.+)", "${user}"), param = c.Value);

最后,您应该在 Claims Provider 中对传入的声明添加一些过滤以增加安全性(即只允许传入的声明与您域的电子邮件后缀等匹配)