views:

1282

answers:

1

If I enable impersonation in a web service with identity="someID"... As web service is MTA application the impersonation that is applied may be applied to a worker thread and not the thread that actually call the method... I guess you might get an access denied error...Without problematically doing impersonation .. just by enabling it in webconfig .. what changes will i have to make to my function which does some clever stuff?

<identity impersonate="true" userName="DomainName\UserName" 
                         password="ClearTextPassword" />

The <identity> element within Web.config supports optional user name and password attributes which allows you to configure a specific fixed identity for your Web service to impersonate. This is shown in the following configuration file fragment... what else do i need to write?

System.Diagnostics.Process[] p = System.Diagnostics.Process.GetProcesses(); 
p.GetExccutiong();
Console.WriteLine();
+1  A: 

IMO, the best way to configure the identity of a web-service is via the host - IIS, for example. In IIS, you can configure this via the app-pool identity (like in this answer). No need for plain-text passwords, and no need for hacky code.

Marc Gravell