@Override
  public void doFilter(HttpRequest request, HttpResponse response, FilterChain filterChain) throws IOException {
    boolean isAuthenticated = authenticate(request, response);
    response.setContentType(MediaTypes.JSON);

    try (JsonWriter jsonWriter = JsonWriter.of(response.getWriter())) {
      jsonWriter.beginObject();
      jsonWriter.prop("valid", isAuthenticated);
      jsonWriter.endObject();
    }
  }
@Test
  public void doFilter_whenForceAuthentication_shouldReturnFalse() throws Exception {
    settings.setProperty("sonar.forceAuthentication", "true");
    underTest.doFilter(request, response, chain);
    verifyResponseIsFalse();
  }