moss form验证 配置文件关键部分

 moss form验证 配置文件关键部分:

  <connectionStrings>
    <!-- Trusted_Connection=True -->
    <add name="AspNetSqlProvider" connectionString="Data Source=(local);Initial Catalog=aspnetdb;User ID=sa;Password=pass_word2005" providerName="System.Data.SqlClient"/>
  </connectionStrings>

 

    <!--Membership Provider -->
    <membership defaultProvider="AspNetSqlMembershipProvider">
      <providers>
        <remove name="AspNetSqlMembershipProvider" />
        <add connectionStringName="AspNetSqlProvider"
          passwordAttemptWindow="10"
          enablePasswordRetrieval="false"
          enablePasswordReset="true"
          requiresQuestionAndAnswer="true"
          applicationName="/"
          requiresUniqueEmail="false"
          passwordFormat="Hashed"
          description="Stores and retrieves membership data from the Microsoft SQL Server database"
          name="AspNetSqlMembershipProvider"
          type="System.Web.Security.SqlMembershipProvider" />
      </providers>
    </membership>
    <!--Role Provider-->
    <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
      <providers>
        <remove name="AspNetSqlRoleProvider" />
        <add connectionStringName="AspNetSqlProvider"
         applicationName="/"
         description="Stores and retrieves roles data from the local Microsoft SQL Server database"
       name="AspNetSqlRoleProvider"
        type="System.Web.Security.SqlRoleProvider" />
      </providers>
    </roleManager>

 

特别说明:管理中心设置数据库连接,membership和Role的provider以后,还需要将默认的Roleprovider修改成
AspNetWindowsTokenRoleProvider
如果这里不设置的话,那么管理中心将没有办法进入进行本地设置。

 

参考:http://hi.baidu.com/garty/blog/item/5d34afefcf8bfe1efcfa3cee.html  (主要是其中提到的要注意的部分)

 

 

也可以是基于AD的form验证,提供程序:AspNetActiveDirectoryMembershipProvider,更简单。

 

你可能感兴趣的:(form)