Subject subject = subjectCallback != null && subjectCallback.getSubject() != null ? subjectCallback.getSubject()
: new Subject();
ServerSecurityManager securityManager;
if ((securityManager = securityManagerValue.getOptionalValue()) != null) {
try {
securityManager.push(name, userName, password, subject);
verifyPasswordCallback.setVerified(true);
subject.getPrivateCredentials().add(new PasswordCredential(userName, password));
if (subjectCallback != null) {
// Only want to deliberately pass it back if authentication completed.
subjectCallback.setSubject(subject);