Lock Down Relying Party based on AD Attribute, Title

RAVI BABU CHIGURUSETTI 1 Reputation point
2020-06-26T18:05:10.277+00:00

Hi All,

We are using the ADFS 3.0. please help me.

As the title states, is it possible to lock down a relying party based on an attribute value a user has in AD?
For example, Our object is to Deny if the user's Title attribute value contains the word as "Contractor".

I have created below two rules in the Issuance Authorization Rule, but its not working.

c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
=> add(store = "Active Directory", types = ("urn:oid:2.5.4.12"), query = ";title;{0}", param = c.Value);

EXISTS([Type == "http://contoso.com/title", Value == "Contractor"])
 => issue(Type = "http://schemas.microsoft.com/authorization/claims/permit", Value = "PermitUsersWithClaim");
Active Directory Federation Services
Active Directory Federation Services
An Active Directory technology that provides single-sign-on functionality by securely sharing digital identity and entitlement rights across security and enterprise boundaries.
1,211 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pierre Audonnet - MSFT 10,166 Reputation points Microsoft Employee
    2020-06-27T14:41:22.92+00:00

    You can make it work with the following three rules in the Issuance Authorization Rules:

    Rule one allowing everyone:

     => issue(Type = "http://schemas.microsoft.com/authorization/claims/permit", Value = "true");
    

    All rules are processed so it's not an issue to have this one. Then extract the title attribute:

    c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
     => add(store = "Active Directory", types = ("temp:/title"), query = ";title;{0}", param = c.Value);
    

    Then you deny the contractors:

    c:[Type == "temp:/title", Value == "Contractor"]
     => issue(Type = "http://schemas.microsoft.com/authorization/claims/deny", Value = "DenyUsersWithClaim");
    
    0 comments No comments