Note that there are some explanatory texts on larger screens.

plurals
  1. POMembership Provider producing unexpected SQL Error
    text
    copied!<p>I am getting the following error when calling Membership.GetUser() on a specific page (first page on the site to do so as we implement proper security controls)</p> <p>System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'IIS APPPOOL\UAT SITE'. at .... at System.Web.Security.SqlMembershipProvider.GetUser(String username, Boolean userIsOnline) at System.Web.Security.Membership.GetUser(String username, Boolean userIsOnline) </p> <p>The site is running fine under IIS Express, but UAT is under IIS 7.5 on 2008R2</p> <p>Web.Config</p> <pre><code>&lt;authentication mode="Windows" /&gt; &lt;identity impersonate="True" /&gt; &lt;authorization&gt; &lt;deny users="?" /&gt; &lt;allow users="*" /&gt; &lt;/authorization&gt; &lt;membership&gt; &lt;providers&gt; &lt;clear /&gt; &lt;add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="DatabaseGTN" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="GTN" /&gt; &lt;/providers&gt; &lt;/membership&gt; &lt;roleManager enabled="true"&gt; &lt;providers&gt; &lt;clear /&gt; &lt;add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="DatabaseGTN" applicationName="GTN" /&gt; &lt;/providers&gt; &lt;/roleManager&gt; </code></pre> <p>Under the "Authentication" node for the site, ONLY ASP.NET Impersonation and Windows Authentication are enabled The Web Server Windows Authentication feature is installed according to the server manager.</p> <p>All other pages on the site are running perfectly happily using the same connection string references, and the audit logging indicates that the correct username COMPANY\MyName is being returned by SYSTEM_USER inside MS SQL, so it looks like every other SQL request is impersonating as expected.</p> <p>Any suggestions for a configuration option that I may have overlooked would be much appreciated.</p> <p>I should make that clearer. Rather than adding an additional DB user or role, I want to get the impersonation working correctly. Or I want to be able to tell my boss why it can't be done.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload