Class AuthenticatedUserDetails

java.lang.Object
com.erudika.para.server.security.AuthenticatedUserDetails
All Implemented Interfaces:
Serializable, org.springframework.security.core.userdetails.UserDetails

public class AuthenticatedUserDetails extends Object implements org.springframework.security.core.userdetails.UserDetails
Stores information about authenticated users.
Author:
Alex Bogdanovski [[email protected]]
See Also:
  • Constructor Details

    • AuthenticatedUserDetails

      public AuthenticatedUserDetails(User user)
      Default constructor.
      Parameters:
      user - an authenticated user object (principal)
  • Method Details

    • getUser

      public User getUser()
      Returns the underlying principal.
      Returns:
      a User object
    • setUser

      public void setUser(User user)
      Sets the principal object.
      Parameters:
      user - a user
    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      A list of roles for this user.
      Specified by:
      getAuthorities in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      a list of roles
    • getUsername

      public String getUsername()
      The username. Same as User.getIdentifier()
      Specified by:
      getUsername in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      User.getIdentifier() if user.appid == root appid, or "appid/user.identifier" if child app,
      See Also:
    • isAccountNonExpired

      public boolean isAccountNonExpired()
      Specified by:
      isAccountNonExpired in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      true if active
      See Also:
    • isAccountNonLocked

      public boolean isAccountNonLocked()
      Specified by:
      isAccountNonLocked in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      true if active
      See Also:
    • isCredentialsNonExpired

      public boolean isCredentialsNonExpired()
      Specified by:
      isCredentialsNonExpired in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      true if active
      See Also:
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      true if active
      See Also:
    • getPassword

      public String getPassword()
      The password. A transient field used for validation.
      Specified by:
      getPassword in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      the password.
    • getIdentifier

      public String getIdentifier()
      Returns the main identifier for this user. An identifier is basically a unique username that identifies a user.
      Returns:
      the main identifier