|
Spring Security Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.security.userdetails.User
public class User
Models core user information retieved by an 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,
GrantedAuthority[] authorities)
Construct the User with the details required by
DaoAuthenticationProvider. |
|
User(String username,
String password,
boolean enabled,
boolean accountNonExpired,
boolean credentialsNonExpired,
GrantedAuthority[] authorities)
Deprecated. use new constructor with extended properties (this constructor will be removed from release 1.0.0) |
|
User(String username,
String password,
boolean enabled,
GrantedAuthority[] authorities)
Deprecated. use new constructor with extended properties (this constructor will be removed from release 1.0.0) |
|
| Method Summary | |
|---|---|
boolean |
equals(Object rhs)
|
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. |
protected void |
setAuthorities(GrantedAuthority[] authorities)
|
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,
GrantedAuthority[] authorities)
throws IllegalArgumentException
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 enabledauthorities - the authorities that should be granted to the caller
if they presented the correct username and password and the user
is enabled
IllegalArgumentException - if a null value was passed
either as a parameter or as an element in the
GrantedAuthority[] array
public User(String username,
String password,
boolean enabled,
boolean accountNonExpired,
boolean credentialsNonExpired,
GrantedAuthority[] authorities)
throws IllegalArgumentException
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 expiredauthorities - the authorities that should be granted to the caller
if they presented the correct username and password and the user
is enabled
IllegalArgumentException - if a null value was passed
either as a parameter or as an element in the
GrantedAuthority[] array
public User(String username,
String password,
boolean enabled,
boolean accountNonExpired,
boolean credentialsNonExpired,
boolean accountNonLocked,
GrantedAuthority[] authorities)
throws IllegalArgumentException
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
IllegalArgumentException - if a null value was passed
either as a parameter or as an element in the
GrantedAuthority[] array| Method Detail |
|---|
public boolean equals(Object rhs)
equals in class Objectpublic 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 otherwiseprotected void setAuthorities(GrantedAuthority[] authorities)
public String toString()
toString in class Object
|
Spring Security Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||