NegotiateRequestWrapper requestWrapper = new NegotiateRequestWrapper(request, windowsPrincipal);
if (this.impersonate) {
LOGGER.debug("impersonating user");
ctx = windowsIdentity.impersonate();
}
chain.doFilter(requestWrapper, response);
} finally {
if (this.impersonate && ctx != null) {