|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.security.core.userdetails.User
public class User
Models core user information retrieved by a UserDetailsService.
Implemented with value object semantics (immutable after construction, like a String).
Developers may use this class directly, subclass it, or write their own UserDetails implementation from
scratch.
| Constructor Summary | |
|---|---|
User(String username,
String password,
boolean enabled,
boolean accountNonExpired,
boolean credentialsNonExpired,
boolean accountNonLocked,
Collection<GrantedAuthority> authorities)
Construct the User with the details required by
DaoAuthenticationProvider. |
|
User(String username,
String password,
boolean enabled,
boolean accountNonExpired,
boolean credentialsNonExpired,
boolean accountNonLocked,
GrantedAuthority[] authorities)
Deprecated. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object rhs)
|
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. |
int |
hashCode()
|
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. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public User(String username,
String password,
boolean enabled,
boolean accountNonExpired,
boolean credentialsNonExpired,
boolean accountNonLocked,
GrantedAuthority[] authorities)
public User(String username,
String password,
boolean enabled,
boolean accountNonExpired,
boolean credentialsNonExpired,
boolean accountNonLocked,
Collection<GrantedAuthority> authorities)
User with the details required by
DaoAuthenticationProvider.
username - the username presented to the
DaoAuthenticationProviderpassword - the password that should be presented to the
DaoAuthenticationProviderenabled - set to true if the user is enabledaccountNonExpired - set to true if the account has not
expiredcredentialsNonExpired - set to true if the credentials
have not expiredaccountNonLocked - set to true if the account is not
lockedauthorities - the authorities that should be granted to the caller
if they presented the correct username and password and the user
is enabled. Not null.
IllegalArgumentException - if a null value was passed
either as a parameter or as an element in the
GrantedAuthority collection| Method Detail |
|---|
public boolean equals(Object rhs)
equals in class Objectpublic Collection<GrantedAuthority> getAuthorities()
UserDetailsnull.
getAuthorities in interface UserDetailsnull)public String getPassword()
UserDetailsnull.
getPassword in interface UserDetailsnull)public String getUsername()
UserDetailsnull.
getUsername in interface UserDetailsnull)public int hashCode()
hashCode in class Objectpublic boolean isAccountNonExpired()
UserDetails
isAccountNonExpired in interface UserDetailstrue if the user's account is valid (ie non-expired), false if no longer valid
(ie expired)public boolean isAccountNonLocked()
UserDetails
isAccountNonLocked in interface UserDetailstrue if the user is not locked, false otherwisepublic boolean isCredentialsNonExpired()
UserDetails
isCredentialsNonExpired in interface UserDetailstrue if the user's credentials are valid (ie non-expired), false if no longer
valid (ie expired)public boolean isEnabled()
UserDetails
isEnabled in interface UserDetailstrue if the user is enabled, false otherwisepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||