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) {