S
Sam Page
My ASP.NET aspx page can impersonate a userX and access a
UNC share just fine.
When I start a thread from the same aspx page, my real
intention, and try to impersonate in the thread method, I
fail with "Unable to Impersonate." The thread
successfully calls LogonUser, DuplicateTokens the
usertoken, creates a WindowsIdentity from the dupetoken,
then fails on the call to WindowsIdentity.Impersonate( ).
I have also tried ImpersonateLoggedOnUser.
Workaround:
If I change machine.config, processModel/@username
from 'machine' to 'system', everything works.
This is a workaround that leaves ASP.NET less secure. I'm
trying to find a way to assign the correct privileges and
associate the thread with the correct identity. No luck,
looking for ideas. Thanks.
UNC share just fine.
When I start a thread from the same aspx page, my real
intention, and try to impersonate in the thread method, I
fail with "Unable to Impersonate." The thread
successfully calls LogonUser, DuplicateTokens the
usertoken, creates a WindowsIdentity from the dupetoken,
then fails on the call to WindowsIdentity.Impersonate( ).
I have also tried ImpersonateLoggedOnUser.
Workaround:
If I change machine.config, processModel/@username
from 'machine' to 'system', everything works.
This is a workaround that leaves ASP.NET less secure. I'm
trying to find a way to assign the correct privileges and
associate the thread with the correct identity. No luck,
looking for ideas. Thanks.