Reputation: 5072
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
Upvotes: 0
Views: 3810
Reputation: 785
That is by what I know correct. If you do not impersonate as the calling user, by default it should run under the default identity from the application pool.
===============================================================================
Below are some good links you can go through these to understand the iis user
In summary:
Infomation source:-
User ASP.NET runs under What are all the user accounts for IIS/ASP.NET and how do they differ?
http://www.bluevisionsoftware.com/WebSite/TipsAndTricksDetails.aspx?Name=AspNetAccount
Source: Shekhar - In which Account By Default ASP.NET 4.0 Code Execute?
Upvotes: 4