B
bvasanth123
Hi
I am running the ASP.NET web application which is running under domain
id USER1. My OS is XP. I had added the following location tag in
machine.config to make my application run under USER1.
</location>
<location path="Default Web Site/WebApplication1">
<system.web>
<identity impersonate="true"
userName="mydomain\USER1"
password="mypassword"/>
</system.web>
</location>
In aspx page, I am displaying windows identity, which displays
mydomain\USER1 as expected.
When I start a new thread from aspx page, thread does not assume anu
identity. I would like to run the new thread under same identity (i.ed
mydomain\USER1). How can I do this impersonation on the thread?. I
tried impersonate() method (see code below), and got error "unable to
impersonate". (variable global.ApplicationIdentity is mydomain\USER1).
Please help
Dim newprin As WindowsPrincipal = New
WindowsPrincipal(Global.ApplicationIdentity)
Thread.CurrentPrincipal = newprin
Dim wi As WindowsImpersonationContext =
Global.ApplicationIdentity.Impersonate()
TryFileAccess()
wi.Undo()
Regards,
Vasanth
I am running the ASP.NET web application which is running under domain
id USER1. My OS is XP. I had added the following location tag in
machine.config to make my application run under USER1.
</location>
<location path="Default Web Site/WebApplication1">
<system.web>
<identity impersonate="true"
userName="mydomain\USER1"
password="mypassword"/>
</system.web>
</location>
In aspx page, I am displaying windows identity, which displays
mydomain\USER1 as expected.
When I start a new thread from aspx page, thread does not assume anu
identity. I would like to run the new thread under same identity (i.ed
mydomain\USER1). How can I do this impersonation on the thread?. I
tried impersonate() method (see code below), and got error "unable to
impersonate". (variable global.ApplicationIdentity is mydomain\USER1).
Please help
Dim newprin As WindowsPrincipal = New
WindowsPrincipal(Global.ApplicationIdentity)
Thread.CurrentPrincipal = newprin
Dim wi As WindowsImpersonationContext =
Global.ApplicationIdentity.Impersonate()
TryFileAccess()
wi.Undo()
Regards,
Vasanth