private void sendAuthResponse(HttpServletResponse response) throws IOException {
        response.setHeader("WWW-Authenticate", String.format("Basic realm=\"%1$s\"", realm)); //$NON-NLS-1$ //$NON-NLS-2$
        response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
    }
Sends a response that tells the client that authentication is required.
@param response the response
@throws IOException when an error cannot be sent
common/servlet/src/main/java/io/apiman/common/servlet/AuthenticationFilter.java