|
Spring Security Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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
DaoAuthenticationProvider
password
- the password that should be presented to the
DaoAuthenticationProvider
enabled
- 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[]
arraypublic 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
DaoAuthenticationProvider
password
- the password that should be presented to the
DaoAuthenticationProvider
enabled
- 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[]
arraypublic 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
DaoAuthenticationProvider
password
- the password that should be presented to the
DaoAuthenticationProvider
enabled
- 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[]
arrayMethod Detail |
---|
public boolean equals(Object rhs)
equals
in class Object
public GrantedAuthority[] getAuthorities()
UserDetails
null
.
getAuthorities
in interface UserDetails
null
)public String getPassword()
UserDetails
null
.
getPassword
in interface UserDetails
null
)public String getUsername()
UserDetails
null
.
getUsername
in interface UserDetails
null
)public int hashCode()
hashCode
in class Object
public boolean isAccountNonExpired()
UserDetails
isAccountNonExpired
in interface UserDetails
true
if the user's account is valid (ie non-expired), false
if no longer valid
(ie expired)public boolean isAccountNonLocked()
UserDetails
isAccountNonLocked
in interface UserDetails
true
if the user is not locked, false
otherwisepublic boolean isCredentialsNonExpired()
UserDetails
isCredentialsNonExpired
in interface UserDetails
true
if the user's credentials are valid (ie non-expired), false
if no longer
valid (ie expired)public boolean isEnabled()
UserDetails
isEnabled
in interface UserDetails
true
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 |