Custom claim rules examples

The syntax of claim rules have always been confusing to me. For that reason and because I believe there are others out there like me, I’ve made a promise to myself to document the ones I do manage to get working. I’m sure there will be cleverer ways to do some of these things but this is where I’ll be adding the ones that have helped me out.

Send UPN without suffix

Rule 1: Get UPN

c:[Type == "", Issuer == "AD AUTHORITY"]
 => add(store = "Active Directory", types = (""), query = ";userPrincipalName;{0}", param = c.Value);

Rule 2: Issue “upnNoSuffix”

c:[Type == ""]
 => issue(Type = "", Value = RegExReplace(c.Value, "@.*$", ""));


Incoming UPN
Outgoing “upnNoSuffix” claimmartin

Leave a Reply

Your email address will not be published.