Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Claims Viewer Web Part

Posted by Paul on June 5, 2016

In this article we can explore the Claims Viewer Web Part.

About Web Part

I was working in a Claims enabled SharePoint Web Application where I felt the need of a Claims Viewer component which could display the current claims of the logged-in user.


You can go the following location to get the web part:


An example is displayed below.


Web Part

The above component is developed as a Web Part and requires Farm Solution for deployment. The C# code runs in the server-side and renders the claims values to the output.


Following is the code which retrieves the claims.

protected void Page_Load(object sender, EventArgs e)


IClaimsPrincipal principal = Thread.CurrentPrincipal as IClaimsPrincipal;

IClaimsIdentity identity = principal.Identity as IClaimsIdentity;

IList<ClaimEntity> list = new List<ClaimEntity>();

foreach (Claim claim in identity.Claims)

list.Add(new ClaimEntity()


ClaimType = claim.ClaimType,

Value = claim.Value,

ValueType = claim.ValueType




Once the user is logged in, the thread will contain the Claims Principal object. We can get the Claims from this object.

Each claim will have the following:

· Claim Type which is the pre-defined URL eg:

· Claim Value which is the actual claim value eg: windowsadministrator

You can use the References for articles on Installation of the Claims Viewer web part.



In this article we have explored the usage of Claims Viewer web part.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s