if (serverResponseDigest.equals(clientResponseDigest)) {
principal.setAuthType(HttpServletRequest.DIGEST_AUTH);
if (request instanceof WinstoneRequest)
((WinstoneRequest) request).setRemoteUser(principal);
else if (request instanceof HttpServletRequestWrapper) {
HttpServletRequestWrapper wrapper = (HttpServletRequestWrapper) request;
if (wrapper.getRequest() instanceof WinstoneRequest)
((WinstoneRequest) wrapper.getRequest())
.setRemoteUser(principal);
else
Logger.log(Logger.WARNING, AUTH_RESOURCES,
"DigestAuthenticationHandler.CantSetUser", wrapper
.getRequest().getClass().getName());
} else
Logger.log(Logger.WARNING, AUTH_RESOURCES,
"DigestAuthenticationHandler.CantSetUser", request
.getClass().getName());