开发者

WCF Data Services with Integrated Authentication issue

开发者 https://www.devze.com 2023-01-16 09:04 出处:网络
I have a web project that has Anonymous access and Integrated Windows authentication enabled. I built a WCF 开发者_高级运维Data Service and since it allows only one authentication, I enabled Integrate

I have a web project that has Anonymous access and Integrated Windows authentication enabled. I built a WCF 开发者_高级运维Data Service and since it allows only one authentication, I enabled Integrated authentication on the service. I am able to view the service in browser. However when I try to query the service for any Entity, it gives me Forbidden error. I tried to enable Anonymous access on service too, but it does not work.

Do I need to give it some other access or it is not possible to enable one authentication on the service itself keeping the project virtual directory as Anonymous and Integrated.

Update: I do no have any operations in my Data Service. For the entities, I have already set the "All" permission on all entities.


Only one authentication method is permitted on a WCF Data Service.

If you choose to go the Integrated Security route then you need to set the credentials after constructing the DataServiceContext.

Something like this would work for using the current user's Windows identity.

employeeEntities = new EmployeeDataService.EmployeeEntities(new Uri("http://.../employeedata.svc"));
employeeEntities.Credentials = CredentialCache.DefaultCredentials;
0

精彩评论

暂无评论...
验证码 换一张
取 消