|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UserDetails
Provides core user information.
Implementations are not used directly by Spring Security for security
purposes. They simply store user information which is later encapsulated
into Authentication
objects. This allows non-security related user
information (such as email addresses, telephone numbers etc) to be stored
in a convenient location.
Concrete implementations must take particular care to ensure the non-null
contract detailed for each method is enforced. See
User
for a
reference implementation (which you might like to extend).
Concrete implementations should be preferably be immutable – they should
have value object semantics, like a String. The UserDetails
may be
stored in a cache and multiple threads may use the same instance. Immutable
objects are more robust and are guaranteed to be thread-safe. This is not strictly
essential (there's nothing within Spring Security itself which absolutely requires it),
but if your UserDetails object can be modified then it's up to you to make
sure that you do so safely and that you manage any caches which may contain copies of
the object.
UserDetailsService
,
UserCache
Method Summary | |
---|---|
Collection<GrantedAuthority> |
getAuthorities()
Returns the authorities granted to the user. |
String |
getPassword()
Returns the password used to authenticate the user. |
String |
getUsername()
Returns the username used to authenticate the user. |
boolean |
isAccountNonExpired()
Indicates whether the user's account has expired. |
boolean |
isAccountNonLocked()
Indicates whether the user is locked or unlocked. |
boolean |
isCredentialsNonExpired()
Indicates whether the user's credentials (password) has expired. |
boolean |
isEnabled()
Indicates whether the user is enabled or disabled. |
Method Detail |
---|
Collection<GrantedAuthority> getAuthorities()
null
.
null
)String getPassword()
null
.
null
)String getUsername()
null
.
null
)boolean isAccountNonExpired()
true
if the user's account is valid (ie non-expired), false
if no longer valid
(ie expired)boolean isAccountNonLocked()
true
if the user is not locked, false
otherwiseboolean isCredentialsNonExpired()
true
if the user's credentials are valid (ie non-expired), false
if no longer
valid (ie expired)boolean isEnabled()
true
if the user is enabled, false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |