Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { CrumbIssuer crumbIssuer = getCrumbIssuer(); if (crumbIssuer == null || !(request instanceof HttpServletRequest)) { chain.doFilter(request, response); return; } HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; if ("POST".equals(httpRequest.getMethod())) { for (CrumbExclusion e : CrumbExclusion.all()) { if (e.process(httpRequest,httpResponse,chain)) return; } String crumbFieldName = crumbIssuer.getDescriptor().getCrumbRequestField(); String crumbSalt = crumbIssuer.getDescriptor().getCrumbSalt(); boolean valid = false; String crumb = extractCrumbFromRequest(httpRequest, crumbFieldName); if (crumb == null) { extractCrumbFromRequest(httpRequest, ".crumb"); } Level level = Jenkins.getAuthentication() == Jenkins.ANONYMOUS ? Level.FINE : Level.WARNING; if (crumb != null) { if (crumbIssuer.validateCrumb(httpRequest, crumbSalt, crumb)) { valid = true; } else { <START> LOGGER.log(level, "Found invalid crumb {0}. Will check remaining parameters for a valid one...", crumb); <END> } } if (valid) { chain.doFilter(request, response); } else { LOGGER.log(level, "No valid crumb was included in request for {0}. Returning {1}.", new Object[] {httpRequest.getRequestURI(), HttpServletResponse.SC_FORBIDDEN}); httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN,"No valid crumb was included in the request"); } } else { chain.doFilter(request, response); } }</code><technical_language>sense print authentication in log, admin user</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { CrumbIssuer crumbIssuer = getCrumbIssuer(); if (crumbIssuer == null || !(request instanceof HttpServletRequest)) { chain.doFilter(request, response); return; } HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; if ("POST".equals(httpRequest.getMethod())) { for (CrumbExclusion e : CrumbExclusion.all()) { if (e.process(httpRequest,httpResponse,chain)) return; } String crumbFieldName = crumbIssuer.getDescriptor().getCrumbRequestField(); String crumbSalt = crumbIssuer.getDescriptor().getCrumbSalt(); boolean valid = false; String crumb = extractCrumbFromRequest(httpRequest, crumbFieldName); if (crumb == null) { extractCrumbFromRequest(httpRequest, ".crumb"); } Level level = Jenkins.getAuthentication() instanceof AnonymousAuthenticationToken ? Level.FINE : Level.WARNING; if (crumb != null) { if (crumbIssuer.validateCrumb(httpRequest, crumbSalt, crumb)) { valid = true; } else { LOGGER.log(level, "Found invalid crumb {0}. Will check remaining parameters for a valid one...", crumb); } } if (valid) { chain.doFilter(request, response); } else { LOGGER.log(level, "No valid crumb was included in request for {0} by {1}. Returning {2}.", new Object[] {httpRequest.getRequestURI(), Jenkins.getAuthentication().getName(), HttpServletResponse.SC_FORBIDDEN}); httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN,"No valid crumb was included in the request"); } } else { chain.doFilter(request, response); } }