title: Accessing remote SQL Server database using Windows authenticated impersonated local account
body: <p>Sorry for the long title...</p>
  
  <p>Here is the situation - 2 machines: </p>
  
  <ol>
  <li>IIS 7.5/App server Windows 2008</li>
  <li>SQL Server 2008</li>
  </ol>
  
  <p>The SQL Server machine has a <strong>local</strong> account <code>SpecialUser1</code>. This account is used as login account in SQL Server itself and has full access to the database.</p>
  
  <p>The IIS machine has an identical <strong>local</strong> account <code>SpecialUser1</code>.</p>
  
  <p>Web application is setup using Windows Authentication + ASP.NET impersonation with that <code>SpecialUser1</code> defined in <strong>identity</strong> tag of <code>web.config</code>. </p>
  
  <pre><code>&lt;identity impersonate="true" userName="SpecialUser1" password="SpecialPassword" /&gt;
  </code></pre>
  
  <p>And it's using Integrated Security access to the SQL Server, defined in a connection string:</p>
  
  <pre><code>&lt;connectionStrings&gt;
     &lt;add name="ConnectionString1" 
          connectionString="Data Source=SQLSERVER1;Initial Catalog=DB1;Integrated Security=SSPI;" 
          providerName="System.Data.SqlClient"/&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Will the web application be able to get access to the SQL Server's database using that impersonated account? Meaning - are these 2 identical accounts mapped to grant access to the database ?</p>
  
  <p>I relied on the information from here: <a href="http://msdn.microsoft.com/en-us/library/bsz5788z(v=vs.100).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bsz5788z(v=vs.100).aspx</a></p>
  
  <p>and here: <a href="http://msdn.microsoft.com/en-us/library/aa292114(v=vs.71).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa292114(v=vs.71).aspx</a></p>
  
  <p>Thanks</p>