boolean authenticated = false;
if (principal == null) {
Identity unauthenticatedIdentity = getUnauthenticatedIdentity();
subjectInfo.addIdentity(unauthenticatedIdentity);
subject.getPrincipals().add(unauthenticatedIdentity.asPrincipal());
authenticated = true;
}
if (authenticated == false) {
AuthenticationManager authenticationManager = context.getAuthenticationManager();