Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 3 down vote accepted
+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.

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

can you please check the link,

http://ldapcp.codeplex.com/

share|improve this answer
    
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 '12 at 7:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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