25

UserDetails 界面有两个属性似乎相同,锁定和启用。

这些难道不是彼此相反的吗?

4

1 回答 1

24

在旧的 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.

于 2009-10-23T04:57:05.257 回答