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 Details

    • name

      private final String name
      The user id
    • password

      private final String password
      The user password
    • authorities

      private final List<org.springframework.security.core.GrantedAuthority> authorities
      The authorities of the user
  • Constructor Details

    • AppUserDetails

      public AppUserDetails(UUID id, String hashPassword, List<org.springframework.security.core.GrantedAuthority> authorities)
      Constructor of AppUserDetails. It takes the user id, the user password and the user authorities and creates a UserDetails object.
      Parameters:
      id - user id
      hashPassword - user password
      authorities - user authorities
  • Method Details

    • getUsername

      public String getUsername()
      Specified by:
      getUsername in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      user id
    • isAccountNonExpired

      public boolean isAccountNonExpired()
      Specified by:
      isAccountNonExpired in interface org.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 interface org.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 interface org.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 interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      true if the user is enabled, always true in this implementation