boolean isValid = authenticationManager.isValid(userPrincipal, clientDigest, subject);
if (isValid) {
WebLogger.WEB_SECURITY_LOGGER.tracef("User: " + userPrincipal + " is authenticated");
userPrincipal = getPrincipal(subject);
sc.getUtil().createSubjectInfo(userPrincipal, clientDigest, subject);
SecurityContextCallbackHandler scb = new SecurityContextCallbackHandler(sc);
if (mappingManager != null) {
// if there are mapping modules let them handle the role mapping
MappingContext<RoleGroup> mc = mappingManager.getMappingContext(MappingType.ROLE.name());
if (mc != null && mc.hasModules()) {
SecurityRolesAssociation.setSecurityRoles(principalVersusRolesMap);