锁定用户与maxInvalidPasswordAttempts无法正常工作 [英] Lock out user with maxInvalidPasswordAttempts not work
问题描述
我尝试做一下经过三次不成功的尝试锁定用户的研究,而无需使用一个数据库,我发现用的SqlMembershipProvider使用它的答案。我修改的Web.config日:
I try to do research about Lock out users after three unsuccessful attempts without using a database, and I found the answer that use it with SQLMemberShipProvider. I modify th Web.config :
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOnCust" timeout="2880" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="WebDBConnection"
maxInvalidPasswordAttempts="3"
minRequiredPasswordLength="6"
passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
但它不工作,我不知道为什么。修改什么,我需要赚更多?
But it doesn't work, I don't know why. What modifications do I need to make more?
推荐答案
尝试设置默认成员资格提供程序,看看是否有帮助。
try setting your default membership provider to see if that helps.
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOnCust" timeout="2880" />
</authentication>
<membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<clear />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="WebDBConnection"
maxInvalidPasswordAttempts="3"
minRequiredPasswordLength="6"
passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
此外,检查,以确保存储过程正确安装,我知道我遇到了与Oracle这个问题,但使用SQL Server时,并没有太多的问题。不伤害检查。
Also, check to make sure the stored procedures are properly installed, I know I ran into that issue with Oracle, but haven't had many problems when using SQL Server. Doesn't hurt to check.
这篇关于锁定用户与maxInvalidPasswordAttempts无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!