Class JwtAuthenticationFilter

java.lang.Object
io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter
All Implemented Interfaces:
jakarta.servlet.Filter

@Extension public class JwtAuthenticationFilter extends Object implements jakarta.servlet.Filter
Filter that processes JWT token
Author:
Kohsuke Kawaguchi
  • Constructor Details

    • JwtAuthenticationFilter

      public JwtAuthenticationFilter()
  • Method Details

    • init

      @Initializer(fatal=false) public static void init() throws jakarta.servlet.ServletException
      Throws:
      jakarta.servlet.ServletException
    • init

      public void init(jakarta.servlet.FilterConfig filterConfig) throws jakarta.servlet.ServletException
      Specified by:
      init in interface jakarta.servlet.Filter
      Throws:
      jakarta.servlet.ServletException
    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse rsp, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
      Specified by:
      doFilter in interface jakarta.servlet.Filter
      Throws:
      IOException
      jakarta.servlet.ServletException
    • shouldApply

      protected boolean shouldApply(jakarta.servlet.http.HttpServletRequest req)
      Returns true for requests that JWT token processing should apply.
    • destroy

      public void destroy()
      Specified by:
      destroy in interface jakarta.servlet.Filter
    • didRequestHaveValidatedJwtToken

      public static boolean didRequestHaveValidatedJwtToken()
      Returns true if the current request had a valid JWT token.