I'm just reading about temporarily impersonating a user in ASP.Net
at http://msdn.microsoft.com/en-us/library/ff647405.aspx
To achieve this the following code is used.
// Temporarily impersonate the original user.
WindowsImpersonationContext wic = wi.Impersonate();
try
{
// Access resources while impersonating.
}
catch
{
// Prevent exceptions propagating.
}
finally
{
// Revert impersonation.
wic.Undo();
}
I am using Windows Server 2008 and have an application pool and just wanted to cofirm that when I am not impersonating by using the above code by default the service will then use the identity of my what I have set for my application pool.
Issue is I want a different security access to resources depending on if the user logged in via windows application or used ASP.Net forms authentication Thanks