Class UserAuthenticated

java.lang.Object
com.bank.auth_service.model.UserAuthenticated
All Implemented Interfaces:
Serializable, org.springframework.security.core.CredentialsContainer, org.springframework.security.core.userdetails.UserDetails

public class UserAuthenticated extends Object implements org.springframework.security.core.userdetails.UserDetails, org.springframework.security.core.CredentialsContainer
Implementation of UserDetails and CredentialsContainer for authenticated users. Used by Spring Security to represent the authenticated user's details and authorities.
Since:
1.0.0
Version:
1.0.0, 06/23/2025
Author:
Fernando Cruz Cavina
See Also:
  • Constructor Details

    • UserAuthenticated

      public UserAuthenticated(User user)
  • Method Details

    • getUsername

      public String getUsername()
      Specified by:
      getUsername in interface org.springframework.security.core.userdetails.UserDetails
    • getPassword

      public String getPassword()
      Specified by:
      getPassword in interface org.springframework.security.core.userdetails.UserDetails
    • isAccountNonExpired

      public boolean isAccountNonExpired()
      Specified by:
      isAccountNonExpired in interface org.springframework.security.core.userdetails.UserDetails
    • isAccountNonLocked

      public boolean isAccountNonLocked()
      Specified by:
      isAccountNonLocked in interface org.springframework.security.core.userdetails.UserDetails
    • isCredentialsNonExpired

      public boolean isCredentialsNonExpired()
      Specified by:
      isCredentialsNonExpired in interface org.springframework.security.core.userdetails.UserDetails
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface org.springframework.security.core.userdetails.UserDetails
    • eraseCredentials

      public void eraseCredentials()
      Specified by:
      eraseCredentials in interface org.springframework.security.core.CredentialsContainer
    • getUser

      public User getUser()
    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      Specified by:
      getAuthorities in interface org.springframework.security.core.userdetails.UserDetails