WCF Service Impersonation
- by robalot
Good Day Everyone...
Apparently, I'm not setting-up impersonation correctly for my WCF service. I do NOT want to set security on a method-by-method basis (in the actual code-behind). The service (at the moment) is open to be called by everyone on the intranet.
So my questions are…
Q: What web-config tags am I missing?
Q: What do I need to change in the web-config to make impersonation work?
The Service Web.config Looks Like...
<configuration>
<system.web>
<authorization>
<allow users="?"/>
</authorization>
<authentication mode="Windows"/>
<identity impersonate="true" userName="MyDomain\MyUser" password="MyPassword"/>
</system.web>
<system.serviceModel>
<services>
<service behaviorConfiguration="wcfFISH.DataServiceBehavior" name="wcfFISH.DataService">
<endpoint address="" binding="wsHttpBinding" contract="wcfFISH.IFishData">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="wcfFISH.DataServiceBehavior">
<serviceMetadata httpGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>