ADFS – 如何针对组声明进行具体化

如何指定一组特定的组来查找和返回ADFS身份validation,而不是在响应消息中search并返回所有用户的组?

这个问题回答了Jim B给出的关于这个问题的答案: 在ADFS中获取嵌套用户组

Jim表示:“除了服务器上的安全和性能问题之外,你应该在你所寻找的小组中具体,而不是返回所有小组,除非安全和性能问题在服务器上,大量的小组返回可能会导致你的应用爬行。 15时18分25秒“

首先阅读索赔规则如何工作可能是一个好主意。 我发现以下technet文章相当有用:

AD FS 2.0声明规则语言入门

了解AD FS 2.0及更高版本中的声明规则语言

简短的版本是,你最终将各种索赔规则串在一起,“存储”查询数据,然后调整/过滤数据,然后实际“发出”与所得到的组声称。

这是我们在我们的环境中使用的一个例子。 对于这个特定的依赖方,我们希望返回以“myapp”开头的所有组成员。 包括嵌套组。

  • 规则1:获取用户的DN c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"] => add(store = "Active Directory", types = ("http://contoso.com/UserDN"), query = ";distinguishedName;{0}", param = c.Value);

  • 规则2:使用成员属性c1:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"] && c2:[Type == "http://contoso.com/UserDN"] => add(store = "Active Directory", types = ("http://schemas.xmlsoap.org/claims/Group"), query = "(member:1.2.840.113556.1.4.1941:={1});cn;{0}", param = c1.Value, param = c2.Value);获取所有嵌套组CN c1:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"] && c2:[Type == "http://contoso.com/UserDN"] => add(store = "Active Directory", types = ("http://schemas.xmlsoap.org/claims/Group"), query = "(member:1.2.840.113556.1.4.1941:={1});cn;{0}", param = c1.Value, param = c2.Value);

  • 规则3:使用正则expression式c:[Type == "http://schemas.xmlsoap.org/claims/Group", Value =~ "(?i)^myapp\."] => issue(claim = c);