title: Access network share using Windows authentication
body: <p>I constantly trip on this when writing apps for our intranet.</p>
  
  <p>Let's say we have a network share called "\\server1\myfolder", and I'm writing an app that needs to read a text file from there. Access to the share is very limited, which is fine. If someone doesn't have access to the folder, the app catches the error and tells the user they don't have access.</p>
  
  <p>This works fine when I run it locally, but when I publish the app to the test server, it never has access to the folder, no matter who is running the app. Ideally the app would impersonate the user and use their credentials, but I never seem to be able to set it up correctly.</p>
  
  <p>My web.config is set up like this:</p>
  
  <pre><code>&lt;authentication mode="Windows"/&gt;
  &lt;identity impersonate="true"/&gt;
  </code></pre>
  
  <p>I've also tried impersonate="false", but it doesn't make a difference. Can someone explain what is going on here, to someone with a very limited knowledge of IIS (this is running on IIS 6 by the way)? Any idea how this should be set up, or is it impossible?</p>