User claims in custom claim provider
-
09-12-2019 - |
Question
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)?
Solution
You 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.
OTHER TIPS
can you please check the link,
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange