This little helper might be useful when you are working with ADFS, but want to use the IdentityModel types in your app:
public static ClaimSet ToClaimSet(this SingleSignOnIdentity identity)
{
List<Claim> claims = new List<Claim>();
claims.Add(new Claim(identity.NameType, identity.Name, Rights.Identity));
foreach (SecurityProperty property in identity.SecurityPropertyCollection)
{
string claimType = property.Uri;
if (claimType.EndsWith(“NameValue”))
{
claimType = property.Name;
}
claims.Add(new Claim(claimType, property.Value, Rights.PossessProperty));
}
return new DefaultClaimSet(ClaimSet.System, claims);
}