【问题标题】:ADFS claims rule iterate AD attributeADFS 声明规则迭代 AD 属性
【发布时间】:2020-10-13 18:06:56
【问题描述】:

如何在 ADFS 中将 AD 属性迭代为声明规则?

更具体地说,我想检查用户的 proxyAddresses 是否包含预先确定的域,如果是,则将该电子邮件作为名称 ID 返回,否则返回用户的主电子邮件。

【问题讨论】:

    标签: adfs claims-authentication


    【解决方案1】:

    您将在声明规则中使用regex 来检查域,如果存在,则发出 NameID 声明。

    然后使用“NOT EXISTS”规则。

    比如:

    NOT EXISTS([Type == "http://contoso.com/NAMID"])
    => add(Type = "http://contoso.com/hasNAMEID", Value = "No");
    
    Sample Rule 2:
    
    c1:[Type == "http://contoso.com/hasNameID"] &&
    c2:[Type == "http://contoso.com/email"]
    => issue(Type="http://contoso.com/email", Value=c2.value);
    

    使用正常的电子邮件声明类型等。

    在写完这篇文章大约 10 分钟后,我在more detail 中找到了这个显示解决方案的示例。

    【讨论】:

    • 谢谢。实际上,我自己设法让事情顺利进行,所以我自己发表评论。
    【解决方案2】:

    我昨天玩了一下,结果如下,这似乎可行,但可能不是最干净的方式?

    规则 #1:

    Proxy-Addresses 和 User-Principal-Name 的常规属性声明

    规则 #2:

    c:[Type == "fake/proxyAddresses", Value =~ "subdomain.example.com$"]
     => issue(Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Value = RegExReplace(c.Value, "smtp:", ""));
    

    规则 #3:

    NOT EXISTS([Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"])
     => add(Type = "fake/UseUPN", Value = "Yes");
    

    规则 #4:

    c1:[Type == "fake/UseUPN"]
     && c2:[Type == "fake/UPN"]
     => issue(Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Value = c2.Value);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多