[Sample Of Jun 2nd] Claim-aware WCF WebService for SharePoint

 

Homepage image
RSS Feed

Sample Download :

CS Version: https://code.msdn.microsoft.com/CSSharePointCallClaimsAware-8f2c3913

VB Version: https://code.msdn.microsoft.com/VBSharePointCallClaimsAware-f26683fc

This sample code will demonstrate how to call a Claims-Aware WCF Service from a SharePoint 2010 Claims Site. We use Service Application Framework (SAF) to host WCF Web Service in IIS.  On the caller's side, we need to use CreateChannelActingAsLoggedOnUser method to send the Claim based SharePoint Logged-on user's security token to our custom web service.  In our custom WCF web service, we need to use System.Threading.Thread.CurrentPrincipal.Identity to get the claim based security token.
image

You can find more code samples that demonstrate the most typical programming scenarios by using Microsoft All-In-One Code Framework Sample Browser or Sample Browser Visual Studio extension. They give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates. If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, or read the introduction on our homepage https://1code.codeplex.com/.