代码之家  ›  专栏  ›  技术社区  ›  Storm

AspNetCore.Identity LockoutOptions.AllowedForNewUsers属性

  •  2
  • Storm  · 技术社区  · 6 年前

    我想知道 AllowedForNewUsers 属性为。这个 documentation

    获取或设置指示是否可以锁定新用户的标志。默认为true。

    但这根本没有告诉我任何有用的东西,从表面上看,这意味着新用户可以被锁定,但这只是荒谬的,因为你已经有了标准锁定功能。

    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;
    

    任何指导都将不胜感激。

    1 回复  |  直到 6 年前
        1
  •  3
  •   Storm    6 年前

    由于“锁定不正确的失败密码尝试次数”是每个用户的选择加入,因此 LockoutOptions.AllowedForNewUsers 会导致 IdentityUser<TKey>.LockoutEnabled

    所以如果 锁定选项.AllowedForNewUsers true 标识用户<TKey>.LockoutEnabled 真的 从而导致用户在 LockoutOptions.MaxFailedAccessAttempts .

    谢谢你 Kirk Larkin 用于过帐 link to this site 这有助于填补一大堆空白。