logger.error(t, JcrI18n.unableToInitializeAuthenticationProvider, component, repositoryName(), t.getMessage());
}
}
// And last set up the anonymous provider ...
AnonymousSecurity anonSecurity = securityConfig.getAnonymous();
if (anonSecurity != null) {
// Set up the anonymous provider (if appropriate) ...
Set<String> anonRoles = anonSecurity.getAnonymousRoles();
if (!anonRoles.isEmpty()) {
String anonUsername = anonSecurity.getAnonymousUsername();
AnonymousProvider anonProvider = new AnonymousProvider(anonUsername, anonRoles);
authenticators = authenticators.with(anonProvider);
logger.debug("Enabling anonymous authentication and authorization.");
}
if (anonSecurity.useAnonymousOnFailedLogings()) {
useAnonymouOnFailedLogins.set(true);
}
}
return authenticators;