Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Membership Provider Fails in 2008 Web Server

Status
Not open for further replies.

Moondusk

Programmer
Nov 13, 2008
4
US
I have windows 2008 web server edition and IIS7, and sql server 2008 web server edition. I am using 3.5 framework with SP1.

On my windows 2000 server and database servers, I use asp.net membership with no problems. But I am having login problems using the membership provider with 2008 and IIS7. I have no problems viewing grids and doing database things that do not require log in. It only effects the membership provider logins and other functionality.

In the app pool I did this:

Set the identity on the app pool in IIS7 to "NetworkService" I tried both Integrated and Classic.

I have forms authentication enabled and anonymous authentication with my SQLIISUser and the password inserted in the IIS7 for this website.

I have tried a connection string with both windows authentication and sql server authentication:

I was told to: update your connection string to "Integrated Security=SSPI;" not "Integrated Security=true;" - which I did.

This gives login failed for anonymous user error:

<add name="XXConnectionString" connectionString="Data Source=xx.xx.xx.xx;Initial Catalog=XX;Integrated Security=SSPI" providerName="System.Data.SqlClient" />

This gives log in failed for SQLIISUser.

<add name="XXConnectionString" connectionString="Data Source=xx.xx.xx.xx;Initial Catalog=XX;
Persist Security Info=True;User ID=SQLIISUser;Password=XXXXXX"
providerName="System.Data.SqlClient" />

My membership settings also include:

<appSettings>
<add key="MembershipConnectionStringName" value="XXConnectionString" />
</appSettings>

<system.web>

<membership defaultProvider="AspNetSqlMembershipProvider" hashAlgorithmType="SHA1" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="XXConnectionString" applicationName="/" passwordFormat="Hashed" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordStrengthRegularExpression="" passwordAttemptWindow="10" />
</providers>
</membership>

<roleManager defaultProvider="AspNetSqlRoleProvider" cacheRolesInCookie="true" cookieName=".ASPXROLES" cookiePath="/" cookieProtection="All" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieTimeout="30" createPersistentCookie="false" maxCachedResults="25" enabled="true">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" connectionStringName="XXConnectionString" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>

On the SQL Server 2008 database, I have the SQLIISUser setup as a user, and given dbdatareader and dbdatawriter and public permissions on the database. I also have a "NT AUTHORITY\NETWORK SERVICE" user with db_owner access.

Again, all database connections work fine remotely, with windows authentication and with sql server authentication if only viewing data in a grid or doing inserts or updates, etc. But once I try to use the membership stuff, that's where it fails.

Please help.

Partial stack trace for login failed for sql user:

System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4844759
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top