SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 1 down vote accepted

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


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


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.