Class HerodotusUser
java.lang.Object
cn.herodotus.engine.oauth2.core.definition.domain.HerodotusUser
- All Implemented Interfaces:
Serializable,org.springframework.security.core.CredentialsContainer,org.springframework.security.core.userdetails.UserDetails
public class HerodotusUser
extends Object
implements org.springframework.security.core.userdetails.UserDetails, org.springframework.security.core.CredentialsContainer
- Author:
- gengwei.zheng
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHerodotusUser(String userId, String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, Set<String> roles, String employeeId, String avatar) Construct theUserwith the details required byorg.springframework.security.authentication.dao.DaoAuthenticationProviderHerodotusUser(String userId, String username, String password, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) Calls the more complex constructor with all boolean arguments set totrue.HerodotusUser(String userId, String username, String password, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, Set<String> roles) Calls the more complex constructor with all boolean arguments set totrue. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the supplied object is aUserinstance with the sameusernamevalue.voidCollection<org.springframework.security.core.GrantedAuthority>getRoles()inthashCode()Returns the hashcode of theusername.booleanbooleanbooleanbooleantoString()
-
Constructor Details
-
HerodotusUser
public HerodotusUser() -
HerodotusUser
public HerodotusUser(String userId, String username, String password, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) Calls the more complex constructor with all boolean arguments set totrue. -
HerodotusUser
public HerodotusUser(String userId, String username, String password, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, Set<String> roles) Calls the more complex constructor with all boolean arguments set totrue. -
HerodotusUser
public HerodotusUser(String userId, String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, Set<String> roles, String employeeId, String avatar) Construct theUserwith the details required byorg.springframework.security.authentication.dao.DaoAuthenticationProvider- Parameters:
username- the username presented to theDaoAuthenticationProviderpassword- the password that should be presented to theDaoAuthenticationProviderenabled- set totrueif the user is enabledaccountNonExpired- set totrueif the account has not expiredcredentialsNonExpired- set totrueif the credentials have not expiredaccountNonLocked- set totrueif 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.- Throws:
IllegalArgumentException- if anullvalue was passed either as a parameter or as an element in theGrantedAuthoritycollection
-
-
Method Details
-
getAuthorities
- Specified by:
getAuthoritiesin interfaceorg.springframework.security.core.userdetails.UserDetails
-
getPassword
- Specified by:
getPasswordin interfaceorg.springframework.security.core.userdetails.UserDetails
-
getUsername
- Specified by:
getUsernamein interfaceorg.springframework.security.core.userdetails.UserDetails
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceorg.springframework.security.core.userdetails.UserDetails
-
isAccountNonExpired
public boolean isAccountNonExpired()- Specified by:
isAccountNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails
-
isAccountNonLocked
public boolean isAccountNonLocked()- Specified by:
isAccountNonLockedin interfaceorg.springframework.security.core.userdetails.UserDetails
-
isCredentialsNonExpired
public boolean isCredentialsNonExpired()- Specified by:
isCredentialsNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails
-
eraseCredentials
public void eraseCredentials()- Specified by:
eraseCredentialsin interfaceorg.springframework.security.core.CredentialsContainer
-
getUserId
-
getRoles
-
getEmployeeId
-
getAvatar
-
equals
Returnstrueif the supplied object is aUserinstance with the sameusernamevalue.In other words, the objects are equal if they have the same username, representing the same principal.
-
hashCode
public int hashCode()Returns the hashcode of theusername. -
toString
-