Package org.localify.auth.dto
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 Summary
ConstructorsConstructorDescriptionLocalifyAuthenticatedUser(UUID id, io.jsonwebtoken.Claims claims, JwtAuthenticationRequest request, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) Constructs a new LocalifyAuthenticatedUser. -
Method Summary
Modifier and TypeMethodDescriptionio.jsonwebtoken.ClaimsGets the JWT claims.Gets the original authentication request.Gets the user's principal.Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
equals, eraseCredentials, getAuthorities, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString
-
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
Gets the user's principal.- Returns:
- The user's principal.
-
getDetails
Gets the original authentication request.- Specified by:
getDetailsin interfaceorg.springframework.security.core.Authentication- Overrides:
getDetailsin classorg.springframework.security.authentication.AbstractAuthenticationToken- Returns:
- The authentication request.
-