Package org.localify.auth.dto
Class JwtAuthenticationRequest
java.lang.Object
org.localify.auth.dto.JwtAuthenticationRequest
- All Implemented Interfaces:
Serializable,Principal,org.springframework.security.core.Authentication,org.springframework.security.core.CredentialsContainer
public class JwtAuthenticationRequest
extends Object
implements org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer
Represents a JWT authentication request.
This class holds the JWT token and other request details like user agent and IP address.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJwtAuthenticationRequest(String token, String userAgent, String ipAddress) Constructs a new JwtAuthenticationRequest. -
Method Summary
Modifier and TypeMethodDescriptionvoidCollection<? extends org.springframework.security.core.GrantedAuthority>Gets the IP address.getName()Gets the user agent.booleanvoidsetAuthenticated(boolean isAuthenticated) toString()
-
Constructor Details
-
JwtAuthenticationRequest
Constructs a new JwtAuthenticationRequest.- Parameters:
token- The JWT token.userAgent- The user agent of the client.ipAddress- The IP address of the client.
-
-
Method Details
-
getUserAgent
Gets the user agent.- Returns:
- The user agent.
-
getIpAddress
Gets the IP address.- Returns:
- The IP address.
-
getCredentials
- Specified by:
getCredentialsin interfaceorg.springframework.security.core.Authentication
-
getAuthorities
- Specified by:
getAuthoritiesin interfaceorg.springframework.security.core.Authentication
-
getDetails
- Specified by:
getDetailsin interfaceorg.springframework.security.core.Authentication
-
getPrincipal
- Specified by:
getPrincipalin interfaceorg.springframework.security.core.Authentication
-
isAuthenticated
public boolean isAuthenticated()- Specified by:
isAuthenticatedin interfaceorg.springframework.security.core.Authentication
-
setAuthenticated
- Specified by:
setAuthenticatedin interfaceorg.springframework.security.core.Authentication- Throws:
IllegalArgumentException
-
eraseCredentials
public void eraseCredentials()- Specified by:
eraseCredentialsin interfaceorg.springframework.security.core.CredentialsContainer
-
getName
-
toString
-