Class AuthenticationMetaData

java.lang.Object
springboot.bg.harisauto.common.config.security.AuthenticationMetaData
All Implemented Interfaces:
Serializable, org.springframework.security.core.AuthenticatedPrincipal, org.springframework.security.core.userdetails.UserDetails, org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal, org.springframework.security.oauth2.core.user.OAuth2User

public class AuthenticationMetaData extends Object implements org.springframework.security.core.userdetails.UserDetails, org.springframework.security.oauth2.core.user.OAuth2User
AuthenticationMetaData.java - Represents the authentication metadata of a user.
Author:
Kristian Popov
See Also:
  • Constructor Details

    • AuthenticationMetaData

      public AuthenticationMetaData(UUID userId, String email, String password, UserRole role, boolean isActive)
      Constructor for users registered through the application.
    • AuthenticationMetaData

      public AuthenticationMetaData(User user, Map<String,Object> attributes)
      Constructor for users registered through the OAuth2 provider.
  • Method Details

    • getAuthorities

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

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

      public String getUsername()
      Specified by:
      getUsername 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
    • getName

      public String getName()
      Specified by:
      getName in interface org.springframework.security.core.AuthenticatedPrincipal