ldapUserAuthenticator,
passwordAuthenticator,
inMemoryRealm));
final Authenticator authenticator = sm.getAuthenticator();
if (authenticator instanceof ModularRealmAuthenticator) {
((ModularRealmAuthenticator) authenticator).setAuthenticationStrategy(new FirstSuccessfulStrategy());
}
sm.setAuthorizer(new ModularRealmAuthorizer(Lists.<Realm>newArrayList(mongoDbAuthorizationRealm, inMemoryRealm)));
final DefaultSubjectDAO subjectDAO = new DefaultSubjectDAO();
final DefaultSessionStorageEvaluator sessionStorageEvaluator = new DefaultSessionStorageEvaluator() {