class MachineLoginFilter extends MultiUserEnvironmentInitializationFilter {

  @Override
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
      throws IOException, ServletException {
    try {
      super.doFilter(request, response, filterChain);
    } catch (NotMachineTokenJwtException mte) {
      filterChain.doFilter(request, response);
    } catch (JwtException e) {
      sendError(
          response,
          SC_UNAUTHORIZED,
          format("Machine token authentication failed: %s", e.getMessage()));
      return;
    }
  }

  @Inject public  MachineLoginFilter(
      SessionStore sessionStore,
      RequestTokenExtractor tokenExtractor,
      UserManager userManager,
      MachineSigningKeyResolver machineKeyResolver,
      PermissionChecker permissionChecker);

}