Subject subject = this.subject == null ? new Subject() : this.subject;
Collection<Principal> allPrincipals = subject.getPrincipals();
allPrincipals.add(userPrincipal);
allPrincipals.add(new RealmUser(securityRealm.getName(), userPrincipal.getName()));
SubjectSupplemental subjectSupplemental = securityRealm.getSubjectSupplemental();
if (subjectSupplemental != null) {
subjectSupplemental.supplementSubject(subject);
}
return new HttpSubjectUserInfo(subject);
}
};