logger.trace("Handling Inbound Message");
trace(msgContext);
AuthenticationManager authenticationManager = null;
try {
authenticationManager = getAuthenticationManager(msgContext);
} catch (ConfigurationException e) {
logger.authenticationManagerError(e);
throw new RuntimeException(e);
}
Principal principal = null;
Object credential = null;
Iterator<Identity> iterator = SecurityContextAssociation.getSecurityContext().getSubjectInfo().getIdentities()
.iterator();
while (iterator.hasNext()) {
CredentialIdentity identity = (CredentialIdentity) iterator.next();
principal = identity.asPrincipal();
credential = identity.getCredential();
}
Subject subject = new Subject();
if (authenticationManager.isValid(principal, credential, subject) == false) {
String msg = ErrorCodes.PROCESSING_EXCEPTION + "Authentication failed, principal=" + principal;
logger.error(msg);
SecurityException e = new SecurityException(msg);
throw new RuntimeException(e);
}