Principal caller = sc.getUtil().getUserPrincipal();
if (caller == null && username == null && clientDigest == null) {
return null;
}
try {
DigestCallbackHandler handler = new DigestCallbackHandler(username, nOnce, nc, cnonce, qop, realm, md5a2);
CallbackHandlerPolicyContextHandler.setCallbackHandler(handler);
Subject subject = new Subject();
boolean isValid = authenticationManager.isValid(incomingPrincipal, clientDigest, subject);
if (isValid) {
WebLogger.WEB_SECURITY_LOGGER.tracef("User: " + incomingPrincipal + " is authenticated");