UserDetails接口有两个似乎相同,已锁定并已启用的属性。
这些只不是另一个吗?
答案 0 :(得分:18)
在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.