Jean Paul's Blog

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

    Advertisements
  • 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

Posts Tagged ‘claims viewer’

Claims Viewer Web Part – Installation

Posted by Paul on June 17, 2016

In this article we can explore how to Download & Install the claims viewer web part for SharePoint 2013.

Download

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

https://sharepoint2013claimsviewer.codeplex.com/

From there choose the Downloads page:

image

You will get the WSP file.

image

The web part is Free for development & commercial use.

Installation

Once you have downloaded the WSP file, you need to install it. This is a Farm Solution so you require PowerShell.

Go to your SharePoint Server & Open the PowerShell window in Administrator mode.

image

You will get the following command window.

image

Run the following command to add the WSP package to Farm Solutions.

· Add-SPSolution “full path”

· Eg: Add-SPSolution “c:shared ClaimsViewerWebPart2013.wsp”

If things went well, you will get the following message.

image

Now run the following command to install the WSP package.

· Install-SPSoluiton ClaimsViewerWebPart2013.wsp –gacdeployment –webapplication http://yourserver

If things went well, you will the following output with no error messages.

image

Now you can come to your SharePoint site > Go to Site Collection features > Activate the following feature.

image

Once you have activated the feature, you can add the Web Part to a page.

Create a new page & choose the Insert web part option. You should be able to see the Claims web part as shown below.
image

Insert the web part & Save the page. You are ready to use the Claims Viewer web part.

image

image

Your claims may be different from the items shown above.

References

https://sharepoint2013claimsviewer.codeplex.com/

Summary

In this article we have explored how to install the Claims Viewer web part.

Advertisements

Posted in SharePoint, SharePoint 2013 | Tagged: , , , | Leave a Comment »

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.

Download

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

https://sharepoint2013claimsviewer.codeplex.com/

Example

An example is displayed below.

image

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.

Code

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

});

RefreshGrid(list);

}

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: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier

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

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

References

https://sharepoint2013claimsviewer.codeplex.com/

Summary

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

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »