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've seen lots of examples on mapping claims attributes in SharePoint but I'm not sure how to access that claim data programmatically.

If I have mapped the claim "SpecialId" from a custom STS and the claim provides a list of the "special" Id's how do I access that list from code?

UPDATE: All of these answers were very helpful, thank you. I gave the answer to C.Marius primarily because he was first and also because it gave me a SharePoint specific code answer.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

Someone actually built a web part extracting all claims from authenticated session

http://allthingssharepoint.wordpress.com/2011/04/14/sharepoint-claims-web-part/

C:\Marius

share|improve this answer
            IClaimsIdentity currentIdentity = System.Threading.Thread.CurrentPrincipal.Identity as IClaimsIdentity;

            //var userName = currentIdentity.Name;

            foreach (Claim claim in currentIdentity.Claims)
            {
                 // claim
            }
share|improve this answer

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.