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 Details

    • JwtAuthenticationRequest

      public JwtAuthenticationRequest(String token, String userAgent, String ipAddress)
      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

      public String getUserAgent()
      Gets the user agent.
      Returns:
      The user agent.
    • getIpAddress

      public InetAddress getIpAddress()
      Gets the IP address.
      Returns:
      The IP address.
    • getCredentials

      public String getCredentials()
      Specified by:
      getCredentials in interface org.springframework.security.core.Authentication
    • getAuthorities

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

      public Object getDetails()
      Specified by:
      getDetails in interface org.springframework.security.core.Authentication
    • getPrincipal

      public Object getPrincipal()
      Specified by:
      getPrincipal in interface org.springframework.security.core.Authentication
    • isAuthenticated

      public boolean isAuthenticated()
      Specified by:
      isAuthenticated in interface org.springframework.security.core.Authentication
    • setAuthenticated

      public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException
      Specified by:
      setAuthenticated in interface org.springframework.security.core.Authentication
      Throws:
      IllegalArgumentException
    • eraseCredentials

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

      public String getName()
      Specified by:
      getName in interface Principal
    • toString

      public String toString()
      Specified by:
      toString in interface Principal
      Overrides:
      toString in class Object