I have a custom claims provider and now I got this new requirement to augment some new claims based on claims which user already has.
How can I get user claims which are already augmented (eg. those coming from ADFS)?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityYou can get claims through below code:
var claimsPrincipal = Page.User as IClaimsPrincipal;
if (claimsPrincipal != null)
{
IClaimsIdentity claimsIdentity = (IClaimsIdentity)claimsPrincipal.Identity;
var userClaims = claimsIdentity.Claims;
}
But if you want to add the claim at the time of augmentation, then probably following link guide you more.
How to Get All User Claims at Claims Augmentation Time in SharePoint 2010
Let me know if this helps you.
can you please check the link,