Class JwtAuthenticationConverter

java.lang.Object
org.localify.auth.jwt.JwtAuthenticationConverter
All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationConverter

public class JwtAuthenticationConverter extends Object implements org.springframework.security.web.authentication.AuthenticationConverter
Converts an HTTP request to a JwtAuthenticationRequest. This class extracts the JWT from the Authorization header.
  • Constructor Details

    • JwtAuthenticationConverter

      public JwtAuthenticationConverter()
  • Method Details

    • convert

      public JwtAuthenticationRequest convert(jakarta.servlet.http.HttpServletRequest request)
      Converts the incoming HttpServletRequest to a JwtAuthenticationRequest.
      Specified by:
      convert in interface org.springframework.security.web.authentication.AuthenticationConverter
      Parameters:
      request - The incoming request.
      Returns:
      A JwtAuthenticationRequest if a token is found, otherwise null.