AD FS 2.0: Dynamic Claim Types
Dynamic Claim Types
There is data stored about a user in a SQL database (or other attribute store). The data stored about the user in the database needs to be a part of the claim type and not the value of the claim.
For example, properties “Redmond” and “Building3” stored in a database, in column “property” about the user.
Desired Result using Dynamic Claim Types:
http://contoso.com/Redmond = “Yes”
http://contoso.com/Building3 = “Yes”
Not Desired Result:
http://contoso.com/property = “Redmond”
http://contoso.com/property = “Building3”
This can be accomplished using two custom claim rules. The first will pull the values stored in the database and place them in a variable claim. The second rule will take those values and use them to dynamically choose the claim types issued. Below is a sample of these two custom claim rules.
Custom Claim Rule 1:
|
Custom Claim Rule 2:
Take the values of each variable claim, and use that to create the dynamic claim with a value of “Yes”. This takes a static string and appends the value of the claim. |