[英]ADFS claims rule iterate AD attribute
如何迭代 AD 屬性作為 ADFS 中的聲明規則?
更具體地說,我想檢查用戶的 proxyAddresses 是否包含預定的域,如果是,則將該電子郵件作為名稱 ID 返回,否則返回用戶的主電子郵件。
您將在聲明規則上使用正則表達式來檢查域,如果存在,則發出 NameID 聲明。
然后使用“ 不存在”規則。
所以像:
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 分鍾后,我發現這個例子更詳細地顯示了解決方案。
我昨天玩了一會兒,最后得到以下結果,這似乎有效,但也許不是最干凈的方法?
規則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);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.