public class CustomUserDetails extends User implements org.springframework.security.core.userdetails.UserDetails
User object to conform
to UserDetails interface, to be used within Authentication Context.| Constructor and Description |
|---|
CustomUserDetails(String email,
String password,
String roleName)
Create new instance of
UserDetails object with
given User details. |
CustomUserDetails(User user)
Create new instance of
UserDetails object with
given User details. |
| Modifier and Type | Method and Description |
|---|---|
Collection<? extends org.springframework.security.core.GrantedAuthority> |
getAuthorities() |
String |
getUsername() |
boolean |
isAccountNonExpired() |
boolean |
isAccountNonLocked() |
boolean |
isCredentialsNonExpired() |
boolean |
isEnabled() |
equals, getEmail, getFirstName, getId, getLastName, getMiddleName, getPassword, getRoles, hashCode, setEmail, setFirstName, setId, setLastName, setMiddleName, setPassword, setRoles, toStringpublic CustomUserDetails(User user)
user - User objectIllegalArgumentException - if argument is nullpublic CustomUserDetails(String email, String password, String roleName)
email - user's emailpassword - user's passwordroleName - Role short nameIllegalArgumentException - if either of arguments is nullpublic Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
getAuthorities in interface org.springframework.security.core.userdetails.UserDetailspublic String getUsername()
getUsername in interface org.springframework.security.core.userdetails.UserDetailspublic boolean isAccountNonExpired()
isAccountNonExpired in interface org.springframework.security.core.userdetails.UserDetailspublic boolean isCredentialsNonExpired()
isCredentialsNonExpired in interface org.springframework.security.core.userdetails.UserDetailspublic boolean isEnabled()
isEnabled in interface org.springframework.security.core.userdetails.UserDetailspublic boolean isAccountNonLocked()
isAccountNonLocked in interface org.springframework.security.core.userdetails.UserDetails