我有一个系统,我们使用ADFS作为身份提供者来提供基于WIF的.NET应用程序的单点login。 所有的工作都很好,我们能够通过所有的要求,例如这里是传递姓氏的规则:
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"] => issue(store = "Active Directory", types = ("http://example.com/identity/claims/portal/lastname"), query = ";sn;{0}", param = c.Value);
但是现在我需要添加两个我遇到麻烦的规则,第一个是通过SID,另一个是通过SAM帐户名(域\用户)。 它们不存在于ADFS声明configuration向导的预定义列表中,而且我正在尝试为这些自定义规则编写自定义规则,但是我无法使其工作。
你能指出我参考如何可以提取这些属性,如果这确实是可能的?
我很抱歉如果我搞砸了一些命名法,我通常只在没有其他select的情况下才能在代码面上search东西。:)所有更正都是值得欢迎的。
传递objectguid而不是SID来获取AD对象的真正不可变的ID。
类似于:
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"] => issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"), query = ";objectGUID;{0}", param = c.Value);
好的,在find这个页面之后,我设法弄清楚了。 我基本上使用不正确的属性名称,在我的情况下,我应该已经使用objectSid和sAMAccountName 。 令我惊讶的是后者也没有与领域的一部分。 所以,如果它帮助别人,这里是样本规则通过SID作为一个索赔:
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"] => issue(store = "Active Directory", types = ("http://example.com/identity/claims/portal/lastname"), query = ";objectSid;{0}", param = c.Value);