IIS Web Application & Virtual Directory Access

I currently have a web application that runs under an app pool impersonating a domain account (my webserver is on the domain).

I am trying to setup a virtual directory within this web application that contains numerous pdf's that will be displayed to the user on the webpage.

When setting up the virtual directory i can test the connection and get a green light, saying the app pool identity has access to the folder.  I have verified the share and security permissions on the physical folder and the app pool impersonate account has full rights.

When the webpage loads it displays the pdf in an iframe.  This works when I have Anonymous Authentication turned on in the virtual directory settings (IUSR) but as soon as I disable this and want it to use windows auth (assuming it is going to use the app pool identity) the pdf will not display and prompts for a login.  I have even tried turing on ASP.Net impersonation for the virtual directory and specifically enter my domain app pool account and it still does not display the pdf.

Is this normal behavior?
Does the local IUSR account have some special setting (security) that my domain account (currently a domain admin acct while I am testing) would not have?
Who is Participating?
Brad HoweConnect With a Mentor DevOps ManagerCommented:
Yes, that does make sense.

App Pool Identity and ASP.NET Impersonation are 2 different things. AppPools are what IIS uses to manage a worker process. ASP.NET Impersonation is at the application level in the web.config of an application. Using impersonation in the web.config allows you to override the set Identity configured in the AppPool.  Think of it as worker process vs application.

Essentially, you will need to modify your web.config to impersonate if you are using windows authentication and disabling anonymous.

  <authentication mode="Windows"/>
    <identity impersonate="true" userName="<domain>\<UserName>" password="<password>"/>

Have a look at:
ASP.NET Impersonation documentation:

Using IIS Authentication with ASP.NET Impersonation: http://msdn.microsoft.com/en-us/library/134ec8tc(v=vs.100).aspx

You can also modify your page to show the security ID as such.

Hope it helps,
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.