c# - WCF Impersonation through configuration -
i have simple wcf service uses wshttpbinding , windows authentication. i'm trying force server impersonate client's identity upon every method call service.
i tried advice given @ wcf service impersonation, not getting happy results. when try navigate landing page wcf service, see error:
the contract operation 'getadvice' requires windows identity automatic impersonation. windows identity represents caller not provided binding ('wshttpbinding','http://tempuri.org/') contract ('imagiceightballservice','http://tempuri.org/'.
any ideas on error's trying tell me?
the entire solution can browsed @ ftp://petio.org/2011/07/01/magiceightball/ (or downloaded @ http://petio.org/2011/07/01/magiceightball.zip). i'm publishing project local iis folder , accessing service @ http://localhost/magiceightball/magiceightballservice.svc.
thanks!
update:
my service's web.config:
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetframework="4.0" /> </system.web> <system.servicemodel> <services> <service name="petio.magiceightball.magiceightballservice" behaviorconfiguration="magiceightballservicebehavior"> <endpoint name="wshttpbinding_windowssecurity_imagiceightballservice" address="http://localhost/magiceightball/magiceightballservice.svc" binding="wshttpbinding" contract="petio.magiceightball.imagiceightballservice" /> <endpoint address="mex" binding="mexhttpsbinding" contract="imetadataexchange" /> </service> </services> <behaviors> <servicebehaviors> <behavior name="magiceightballservicebehavior"> <servicemetadata httpgetenabled="true" httpsgetenabled="true"/> <servicedebug includeexceptiondetailinfaults="true"/> <serviceauthorization impersonatecallerforalloperations="true" /> </behavior> </servicebehaviors> </behaviors> </system.servicemodel> </configuration>
my service code:
public class magiceightballservice : imagiceightballservice { [operationbehavior(impersonation=impersonationoption.required)] public string getadvice() { magiceightball ball = new magiceightball(); return ball.getadvice(); } }
what minimizing whole problem simplest reproducible code can show here? nobody interested in downloading , reviewing whole project. later reference related code should still here.
i checked configurations of project , client code , see 2 blocking issues:
- if want enforce impersonation configuration must use bindings windows authentication - endpoint exposed on https without authentication.
- impersonation in wcf requires client allow service impersonate identity setting configuration on service not enough.
here have article impersonation , necessary / possible settings.
Comments
Post a Comment