Class LocalifyAuthenticatedUser

java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
org.localify.auth.dto.LocalifyAuthenticatedUser
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

public class LocalifyAuthenticatedUser extends org.springframework.security.authentication.AbstractAuthenticationToken
Represents an authenticated Localify user. This class extends AbstractAuthenticationToken and holds the user's details, claims, and request details.
See Also:
  • Constructor Details

    • LocalifyAuthenticatedUser

      public LocalifyAuthenticatedUser(UUID id, io.jsonwebtoken.Claims claims, JwtAuthenticationRequest request, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
      Constructs a new LocalifyAuthenticatedUser.
      Parameters:
      id - The user's ID.
      claims - The JWT claims.
      request - The original authentication request.
      authorities - The user's authorities.
  • Method Details

    • getCredentials

      public io.jsonwebtoken.Claims getCredentials()
      Gets the JWT claims.
      Returns:
      The JWT claims.
    • getPrincipal

      public UserDetailsImpl getPrincipal()
      Gets the user's principal.
      Returns:
      The user's principal.
    • getDetails

      public JwtAuthenticationRequest getDetails()
      Gets the original authentication request.
      Specified by:
      getDetails in interface org.springframework.security.core.Authentication
      Overrides:
      getDetails in class org.springframework.security.authentication.AbstractAuthenticationToken
      Returns:
      The authentication request.