Question on Claims in SharePoint 2010
-
7 iunie 2010 13:07
Hi All,
I have a claim based Application with SQL Server as Provider. I have created a web part and deployed on Claim based web application and now I am able to retrieve the Claim sets with below code
IClaimsPrincipal claimsPrincipal =Page.user as IClaimsPrincipal;
IClaimsIdentity claimsIdentity = (IClaimsIdentity)claimsPrincipal.Identity;
This is good, now I have a Custom WCF Service Hosted in _Vti_bin and Avaiable to Claim Based Application as Virtual Directory.
So My question is : Can I Access claims same way as I am doing in Web Part as this WCF service is running under same context?
Am I missing something or this approach is possible?
Thanks in Advance!!
Pathik
Toate mesajele
-
17 octombrie 2010 12:24
Hi all,
This is resolved now. You can not access Claims in Web Service. I have solved by getting the Claims in Web part which consumes Web service. Once I get the Claims I also create SPUser with Claims Set. Then Claims set is converted to SAML Token and passed to Web Service. Then Name Identifier is extracted from SAML and SPUSer is populated.
Pathik Rawal Blog: http://pathikhrawal.wordpress.com- Marcat ca răspuns de Pathik Rawal 17 octombrie 2010 12:24
- Anulare marcare ca răspuns de GuYumingMicrosoft Contingent Staff, Moderator 7 ianuarie 2011 09:30
-
7 ianuarie 2011 09:29ModeratorPlease read http://blogs.msdn.com/b/ericwhite/archive/2010/05/13/determining-caller-identity-within-a-wcf-web-service.aspx for getting the caller identity within a claim enabled wcf web service.