Impersonate WCF service to run under a specific Domain Account(Hosted on IIS)

I want my WCF service which is host on IIS server should impersonate to a specific Domain Account. In case of a normal website I am using below code to impersonate to specific domain account :

  <!-- ASP.NET runs as the specified user -->
  <identity impersonate="true"
            password="password" />

I need something similar approach which I can use in my WCF service web.config file to impersonate to a specific domain account so that all WCF's operation will run under this account.


I don't know whether is a good approach or not, however I used the following steps to resolve my issue.

    <serviceHostingEnvironment aspNetCompatibilityEnabled="True">
      <service name="Service" behaviorConfiguration="ServiceBehavior">
        <endpoint address="" binding="basicHttpBinding" contract="IService">
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        <behavior name="ServiceBehavior">
          ........some othere setting

Add I under the system.web I use the following code

        <allow users="?"/>
  <identity impersonate="true" userName="DOMAIN\user" password="password" />

on Service.vb class I added

<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Required)> _
Public Class Service Implements IService

Need Your Help

Layout in Fixed with GTK3

python layout gtk gtk3

How can I make window with scrollable Layout and overlay image with fixed position on top of it?

Drawing Bezier curves in MonoGame (XNA) produces scratchy lines

c# xna rounding monogame bezier

I recently got into using MonoGame, and I love the library.