Impersionation like in ASP.NET for WCF Service

thetownman

New Member
I've got a WebService with ASP.NET sites and WCF services in the same web.config. Until now, I was able to use the ASP.NET impersionation in the WCF services by setting\[code\]<system.web> <compilation targetFramework="4.0" debug="false"/> <!-- switch custom errors of--> <identity impersonate="true"/> <customErrors mode="Off"/></system.web>\[/code\]However, now (for other reasons-> Cookieless Session state for the ASP.NET part) I have to set the \[code\]aspNetCompatibilityEnabled="true" \[/code\]option to false. With this I loose the ASP.NET impersionation for the WCF services. One of my WCF services needs impersionation for IO operations on the server...I would like to know how to get the same impersionation I had before by directly defining it on the WCF service configuration.What I have tried (unsucessfully) is to set \[code\][OperationBehavior(Impersonation = ImpersonationOption.Required)]\[/code\]on the implementation of the methods in the WCF service and then specifying \[code\]<endpoint address="" binding="wsHttpBinding" contract="IService"> <identity> <servicePrincipalName value="http://stackoverflow.com/questions/12777510/HOST/YourMachineName" /> <dns value="" /> </identity></endpoint>\[/code\]in the web.config (obviously with the correct values for my service), as described in http://msdn.microsoft.com/en-us/library/ff650591.aspx.However, the WCF service can not be called anymore after this... It tells me that the WsHttpBinding does not offer an identity for the contract.Am I missing something important?
 
Back
Top