spring security:帐户锁定和未启用之间的区别是什么

时间:2009-10-23 04:26:26

标签: java security spring-security

UserDetails接口有两个似乎相同,已锁定并已启用的属性。

这些只不是另一个吗?

1 个答案:

答案 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.

相关问题