Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Connecting to WCF Services using BCS - double hop issue

$
0
0

hi,

This is related to calling WCF Service using BCS. The topology of my sharepoint farm is as below along with the various services that are deployed.

1. SharePoint Web front End Server - (separate physical box) Having a Web Application using claims based authentication

2. SharePoint Application Server - (separate physical box) Hosting BCS Services and External Content Types (by connecting to WCF Services)

3. IIS Server - (separate physical box) Hosting WCF Services using HTTPS Protocol (these services connect to SQL Server Database for all CRUD operations).

INFOPATH FORM -> BCS -> WCF -> SQL

The challenge that i am facing is while i am trying to access the BCS Instance and call the WCF Service (via the BCS instance), it gives me an error

“Unauthorized code handled by the exception”.

“Attempted to perform an unauthorized operation. The user 0#.w|chc\spservice does not have View access on FacilityService.

Looks like the call to the WCF Service via BCS is being made by using the IIS App Pool Account where the WCF Service is hosted instead of using the user's credential to connect from BCS to WCF Service.

Source Code below:

               IEntityInstance instance = BCSUtil.GetItemById("FLOW-FacilityService","http://apps.chc.com/FLOW","Facility", 2);

               instance[FacilityColumns.FacilityStatusLookupTypeId] = "124";

               instance.Update();

               return"Success";

The following sub method gets called using theBCSUtil.GetItemById

       [SharePointPermission(SecurityAction.Demand, ObjectModel = true)]

       publicstaticIEntityInstance GetItemById<T>(string instanceName, string nameSpace,string ctName, T id)

       {

           IEntityInstance item =null;

           IMetadataCatalog catalog = GetMetadataCatalog();

           if (catalog !=null)

           {

               ILobSystemInstance lobSystemInstance =

                     catalog.GetLobSystem(instanceName).GetLobSystemInstances()[instanceName];

               IEntity entity = catalog.GetEntity(nameSpace, ctName);

               INamedMethodInstanceDictionary methods = entity.GetMethodInstances(MethodInstanceType.Finder);

               Identity identity =newIdentity(id);

               item = entity.FindSpecific(identity, lobSystemInstance);

           }

           return item;

       }

looks like a double hop issue.

Please help to resolve.

Thanks

Ram


Thanks Ram


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>