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

弹簧安全:账户锁定和未启用有什么区别?

  •  12
  • flybywire  · 技术社区  · 15 年前

    userdetails接口有两个看起来相同的属性:锁定和启用。

    这不是一个相反的吗?

    1 回复  |  直到 15 年前
        1
  •  16
  •   Bostone    15 年前

    发现了这个 old Acegi blog -希望有帮助

    Disabled indicates an account has been administratively or automatically disabled for some reason. Usually some action is required to release it.

    Locked indicates an account has been automatically suspended due to invalid login attempts. Usually the passage of time or (less often) requesting manual unlocking is required to release it.

    The distinction is not used by Acegi Security code aside from providing more informative errors to the user. There is also an order in which different exceptions should be returned, so that a disabled or locked account for instance will not return a bad credentials exception. Refer to the JavaDocs for more details.