【发布时间】:2011-07-13 01:18:57
【问题描述】:
使表单身份验证起作用的最简单方法是什么?我需要设置 IIS/Active Directory 吗?如果是这样,你将如何编码?
我正在查看本教程,但它有点长、难且令人困惑: http://msdn.microsoft.com/en-us/library/ms464040.aspx
这是我的 web.config 信息:
<configuration>
<connectionStrings>
<add name="OleConnectionStringSource" connectionString="Data Source=dev-sql01; Integrated Security=SSPI; Initial Catalog=PriceFinder;Integrated Security=false"
providerName="System.Data.SqlClient" />
<add name="OleConnectionStringTarget" connectionString="Data Source=dev-sql01; Integrated Security=SSPI; Initial Catalog=PriceFinder;Integrated Security=false"
providerName="System.Data.OleDb;" />
<add name="PriceFinderConnectionString" connectionString="Data Source=dev-sql01; Integrated Security=SSPI; Initial Catalog=PriceFinder;Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="PriceFinderConnectionString2" connectionString="Data Source=dev-sql01;Integrated Security=SSPI; Initial Catalog=PriceFinder;Integrated Security=True"
providerName="System.Data.SqlClient" />
<!--run aspnet_regsql.exe on alg-sql01 when I get write access to alg-sql01, add Data Source=alg-sql01;User ID=PriceFinderUser;Password=speg#st!9e8_#as;
delete Integrated Security=SSPI; line -->
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/default.aspx" timeout="2880" />
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="OleConnectionStringSource"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
谢谢! :)
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
【问题讨论】:
-
链接指向“我如何创建自定义网络服务”...网络服务与成员资格和身份验证无关
标签: asp.net security active-directory forms-authentication