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);