public void commence()

in src/main/java/com/epam/digital/data/platform/bphistory/service/api/config/UnauthorizedRequestHandler.java [52:59]


  public void commence(HttpServletRequest request, HttpServletResponse response,
      AuthenticationException e) throws IOException {
    restAuditEventsFacade.sendExceptionAudit(EventType.SECURITY_EVENT, ResponseCode.AUTHENTICATION_FAILED);
    response.setContentType(MediaType.APPLICATION_JSON_VALUE);
    response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
    response.getWriter().write(objectMapper.writeValueAsString(
        newDetailedResponse(ResponseCode.AUTHENTICATION_FAILED)));
  }