ContextManager.registerSubject(defaultSubject);
SubjectId id = ContextManager.getSubjectId(defaultSubject);
defaultSubject.getPrincipals().add(new IdentificationPrincipal(id));
}
PolicyContextValve policyValve = new PolicyContextValve(securityHolder.getPolicyContextID());
addValve(policyValve);
//This is definitely a hack, but I don't see a reasonable way to install the defaultSubject.
//Obviously this won't work if there are permissions. Setting the default subject if there are
//permissions breaks authentication.