[英]AspNetCore.Identity LockoutOptions.AllowedForNewUsers Property
I'm trying to understand what the purpose of the AllowedForNewUsers
property is for. 我试图了解
AllowedForNewUsers
属性的用途。 The documentation states that it: 文档指出:
Gets or sets a flag indicating whether a new user can be locked out.
获取或设置一个标志,该标志指示是否可以锁定新用户。 Defaults to true.
默认为true。
But this simply doesn't tell me anything of use, at face value it means that new users can be locked out but that's simply nonsensical since you already have the standard lockout feature. 但这根本没有告诉我任何使用,从表面上看,这意味着可以锁定新用户,但这完全是荒谬的,因为您已经具有标准的锁定功能。
I've even checked the Git change log for when it was implemented but that was also of no help. 我什至检查了Git更改日志的实现时间,但这也没有帮助。
/// Gets or sets a flag indicating whether users can be locked out after creation.
/// </summary>
/// <value>
/// True if a newly created user can be locked out, otherwise false.
/// </value>
/// <remarks>
/// Defaults to true.
/// </remarks>
public bool AllowedForNewUsers { get; set; } = true;
Any guidance would be highly appreciated. 任何指导将不胜感激。
Since the "lock out on incorrect number of failed password attempts" is an opt-in per user, the value for LockoutOptions.AllowedForNewUsers
will cause the IdentityUser<TKey>.LockoutEnabled
value to be set the same when creating a new user. 自“锁定在密码尝试失败数不正确”是每用户一个选择,该值
LockoutOptions.AllowedForNewUsers
将使IdentityUser<TKey>.LockoutEnabled
值创建新用户时可以设置的相同。
So if LockoutOptions.AllowedForNewUsers
is true
then the IdentityUser<TKey>.LockoutEnabled
will also be set to true
and thus cause the user to be locked out after LockoutOptions.MaxFailedAccessAttempts
. 因此,如果
LockoutOptions.AllowedForNewUsers
为true
则IdentityUser<TKey>.LockoutEnabled
也将设置为true
,从而使用户在LockoutOptions.MaxFailedAccessAttempts
之后被锁定。
Thank you Kirk Larkin for posting the link to this site which helps fill in a bunch of the blanks. 感谢Kirk Larkin发布了指向该网站的链接,该链接有助于填补空白。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.