IIS7 Manager - SQL/ASP.NET Memebership Setup

Discussion in 'Windows / IIS' started by rhirsch, Mar 3, 2010.

  1. I have installed the aspnet_regsql process to my add on SQL server 2005 and I see the tables/SPs in my database. So step 1 of getting ASP.NET Membership API working was a success, and updated the necessary settings to setup forms validation, and deny users, etc...

    I then changed my root web.config file to add a custom membership as follows to connect to the SQL Server, given my connection string which is also defeined:

    <membership defaultProvider="MyMembershipProvider">
    <providers>
    <add
    connectionStringName="XXXX"
    applicationName="XXXX"
    enablePasswordRetrieval="false"
    enablePasswordReset="true"
    requiresQuestionAndAnswer="true"
    requiresUniqueEmail="true"
    passwordFormat="Hashed"
    name="MyMembershipProvider"
    type="System.Web.Security.SqlMembershipProvider" />
    </providers>
    </membership>

    I see this change when I look in IIS7 Manager which I also have hooked up to my website under the profiles section.

    However, when I try to use IIS Manager to add .NET Users I get an error as follows:

    "The feature can not be used because the default provider type could not be determined to check whether it is a trusted provider."

    This is my first time trying to setup Form Based Authentication with the SQL Sever 2005 back end / IIS7.

    Am I missing something obvious?

    Any help on how to get this working, or another forum post (which I searched for but didn't find) that can assist me would be greatly appreciated.

    Thank you in advance for your help.
     
  2. Solution

    The solution:

    1) Make sure that you clear the default inherited role and membership providers in their respecitve sections by calling:

    <clear />

    in the respecitve <providers> tag for the role/membership provider.

    This will clear error messges about connection LocalSqlServer not found...

    2)

    a)For SQL Role Providers use the type:
    "System.Web.Security.SqlRoleProvider, System.Web,Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

    b) For SQL Memebership Providers use the type:
    "System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

    3) One last tip:

    When you try to add a new memeber if you get "The specified password is invalid. Type a new password"

    Make sure that in your default membership provider that you put in the following tabs in the web.config xml document as they are not exposed in the IIS Manager (thus making it confusing:

    minRequiredPasswordLength="X" minRequiredNonalphanumericCharacters="X"

    ...and replace X depending on your requirements.

    Hope this helps as this burnt and entire day of my time trying to utlilize the framework that is supposed to be faster to implement than a customer form based authentication.
     
  3. mjp

    mjp

    Thanks for posting the follow-up.
     

Share This Page