加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

active-directory – Office 365 ADFS身份验证不适用于子域

发布时间:2020-12-14 00:29:23 所属栏目:Windows 来源:网络整理
导读:一家公司正在使用Office 365和ADFS身份验证; AD Connect用于目录同步,ADFS是 Windows Server 2012 R2版本. 该公司有多个Active Directory域: parent1.com child1.parent1.com child2.parent1.com child3.parent1.comparent2.com ...... 根域在Office 365中
一家公司正在使用Office 365和ADFS身份验证; AD Connect用于目录同步,ADFS是 Windows Server 2012 R2版本.

该公司有多个Active Directory域:

parent1.com
    child1.parent1.com
    child2.parent1.com
    child3.parent1.com
parent2.com
    ...
...

根域在Office 365中配置为联合域(公共域名和AD域名相同);这很好用,用户可以使用他们的UPN登录到Office 365,例如user1@parent1.com,以及他们的AD密码.

我需要添加对子域的支持;因此,我通过运行以下命令将child1.parent1.com添加到Office 365(使用Connect-MsolService连接到具有管理员帐户的Office 365之后):

New-MsolFederatedDomain -DomainName child1.parent1.com -SupportMultipleDomain

(N.B.如果我没有使用SupportMultipleDomain参数,PowerShell会给出一个错误,说明它是必需的).

然后我继续在私有和公共DNS中添加所有必需的DNS记录; Office 365验证DNS记录报告一切正常.

然后将子域添加到AD Connect,并执行同步;因此,子域中的用户出现在Office 365中,其用户名如user1@child1.parent1.com.我为他们分配了适当的许可证,并尝试登录Office 365门户.

但是,子域的用户无法登录;他们收到“无效请求”错误,并提供以下附加详细信息:

Correlation ID: b1e47d45-b21c-42e9-9758-265804db7171 
Timestamp: 2016-08-10 20:27:48Z 
AADSTS50107: Requested federation realm
object 'http://child1.parent1.com/adfs/services/trust/' does not exist.

在ADFS方面显然有些不对劲,但我不是它的专家,我也不是那个设置它的人;如何解决此问题,以便子域中的用户可以成功登录到Office 365?

这个问题很少被记录( a Technet blog post和 some documentation for Azure AD),但它确实存在,并且它是由ADFS在某些特定情况下不能正常运行(多个顶级联合域并在混合中抛出联合子域)引起的;该解决方案涉及在ADFS声明规则中编辑正则表达式,该规则用于构建与用户的UPN关联的IssuerUri.引自第二篇文章:
So lets say for example that I have bmcontoso.com and then add
corp.bmcontoso.com. This means that the IssuerUri for a user from
corp.bmcontoso.com will need to be http://bmcontoso.com/adfs/services/trust.
However the standard rule implemented above for Azure AD,will generate a
token with an issuer as http://corp.bmcontoso.com/adfs/services/trust
which will not match the domain's required value and authentication will fail.

要解决此问题,应编辑ADFS中的第三个声明规则

c:[Type == "http://schemas.xmlsoap.org/claims/UPN"] => issue(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/issuerid",Value = regexreplace(c.Value,".+@(?<domain>.+)","http://${domain}/adfs/services/trust/"));

c:[Type == "http://schemas.xmlsoap.org/claims/UPN"] => issue(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/issuerid","^((.*)([.|@]))?(?<domain>[^.]*[.].*)$","http://${domain}/adfs/services/trust/"));

但是,请注意这可能会破坏与其他方案的兼容性,例如其父域未联合的实际第三级联合域.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读