« Previous Next »

Thread: Authentication for Membership Provider not working with IIS7

Last post 11-14-2008 7:49 AM by MoonCSD. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 11-13-2008, 4:56 PM

    • MoonCSD
    • Not Ranked
    • Joined on 10-17-2008, 4:35 PM
    • Posts 5

    Authentication for Membership Provider not working with IIS7

    I have windows 2008 web server edition and IIS7, and sql server 2008 web server edition.

    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!

     

  • 11-14-2008, 7:49 AM In reply to

    • MoonCSD
    • Not Ranked
    • Joined on 10-17-2008, 4:35 PM
    • Posts 5

    Re: Authentication for Membership Provider not working with IIS7

Page 1 of 1 (2 items)
Microsoft Communities