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

Is it possible to read claims by using the SPUser object only? STS is used as claimsprovider.

All examples I have found use: var claimsPrincipal = Page.User as IClaimsPrincipal; claimsIdentity = (IClaimsIdentity)claimsPrincipal.Identity;

But I need the claims of any spuser not just the current.

I have verified that the FillMethod in the claimsprovider trigges by runnung EnsureUser() but I can't find a way to get hold of the users claims.

Is it possible?

share|improve this question
up vote 0 down vote accepted

Ultimately the claims are created from a source outside of Sharepoint, and the user must authenticate through that source to get their claims assigned. Sharepoint can't get the claims for users who are not currently logged in, because it can't authenticate to the STS as that user and the claims the STS gives the user could change.

share|improve this answer
Thank you for all replies! I have come to the same conclusion. The only claim accessible is the identity or login name. But it's strange that the EnsureUser() method on a SPWeb will trigger claims Fill metods on the STS. – moregardh Oct 2 '12 at 16:58

have you looked at this?

SPUser spUser = web.EnsureUser(string.Format("i:0#.f|providerName|{0}", fbaUser.UserName)); spUser.Name = "FriendlyName"; spUser.Update();

How to map Claims to SPUser object?

hope it helps :)

share|improve this answer

Maybe this could be useful:

SPUser user = ...;
SPClaim claim = SPClaimProviderManager.Local.ConvertSPUserToClaim(user);
share|improve this answer
That will provide the single identity claim for that user, and not the full claim set. There are also bugs when using this through ADFS as noted in the comments on the MSDN page – lgaud Oct 2 '12 at 15:15
What IS the correct method and what does return the full claim set Igaud? – Dennis G Feb 27 '15 at 15:58

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.