WCF Service Impersonation

Posted by robalot on Stack Overflow See other posts from Stack Overflow or by robalot
Published on 2010-04-20T17:23:04Z Indexed on 2010/04/20 17:33 UTC
Read the original article Hit count: 515

Filed under:
|
|

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>

© Stack Overflow or respective owner

Related posts about wcf

Related posts about wcfservice