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

fly*_*ire 15 java security spring-security

UserDetails接口有两个看似相同,已锁定和启用的属性.

这些只不是另一个吗?

Bos*_*one 19

旧的Acegi博客上发现这一点- 希望它有所帮助

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.

  • 可以对`accountExpired`说同样的话吗? (2认同)