0

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)?

2 Answers 2

3
+50

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.

3
  • 1
    Make sure you add a reference to Microsoft.IdentityModel.dll which comes with Windows Identity Foundation
    – Jon Lester
    Oct 2, 2012 at 12:35
  • Link looks promising. I'll check that and get back with result.
    – jjczopek
    Oct 5, 2012 at 16:41
  • 1
    This is exactly what I was looking for (link to Steve Peshka's Blog)!
    – jjczopek
    Oct 7, 2012 at 12:15
0

can you please check the link,

http://ldapcp.codeplex.com/

1
  • While this may theoretically answer the question, we prefer inclusion of the essential parts of the answer here, and to provide the link for reference. See answer for general guidelines.
    – SPDoctor
    Oct 5, 2012 at 7:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.