Package it.univr.passportease.config
Class AppUserDetails
java.lang.Object
it.univr.passportease.config.AppUserDetails
- All Implemented Interfaces:
Serializable
,org.springframework.security.core.userdetails.UserDetails
public class AppUserDetails
extends Object
implements org.springframework.security.core.userdetails.UserDetails
Implementation of
UserDetails
that represents a user- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAppUserDetails
(UUID id, String hashPassword, List<org.springframework.security.core.GrantedAuthority> authorities) Constructor ofAppUserDetails
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.security.core.userdetails.UserDetails
getAuthorities, getPassword
-
Field Details
-
name
The user id -
password
The user password -
authorities
The authorities of the user
-
-
Constructor Details
-
AppUserDetails
public AppUserDetails(UUID id, String hashPassword, List<org.springframework.security.core.GrantedAuthority> authorities) Constructor ofAppUserDetails
. It takes the user id, the user password and the user authorities and creates aUserDetails
object.- Parameters:
id
- user idhashPassword
- user passwordauthorities
- user authorities
-
-
Method Details
-
getUsername
- Specified by:
getUsername
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- user id
-
isAccountNonExpired
public boolean isAccountNonExpired()- Specified by:
isAccountNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if the user is not expired, always true in this implementation
-
isAccountNonLocked
public boolean isAccountNonLocked()- Specified by:
isAccountNonLocked
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if the user is not locked, always true in this implementation
-
isCredentialsNonExpired
public boolean isCredentialsNonExpired()- Specified by:
isCredentialsNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if the user credentials are not expired, always true in this implementation
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if the user is enabled, always true in this implementation
-