Мы пытаемся реализовать LDAP с дополнительными конфигурациями, используя класс DefaultSpringSecurityContextSource. Как одно из наших правил безопасности, повторная попытка - это свойство, которое должно быть реализовано, но в contextSource нет метода, который бы позволял это. Есть ли у Spring Boot автоматическая попытка повторной попытки с пулом?
@Autowired
private DefaultSpringSecurityContextSource context;
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().fullyAuthenticated()
.and()
.formLogin();
}
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
auth
.ldapAuthentication()
.userSearchFilter("(sAMAccountName={0})")
.contextSource(context);
}
@Bean
public DefaultSpringSecurityContextSource createContext() {
DefaultSpringSecurityContextSource contextSource = new DefaultSpringSecurityContextSource("SERVER_LINK");
contextSource.setUserDn(ldapSecurityPrincipal);
contextSource.setPassword(ldapPrincipalPassword);
contextSource.setReferral("follow");
Map<String, Object> environment = new HashMap<>();
environment.put("com.sun.jndi.ldap.connect.timeout", "10000");
environment.put("com.sun.jndi.ldap.read.timeout", "15000");
environment.put("com.sun.jndi.ldap.connect.pool.initsize","6");
environment.put("com.sun.jndi.ldap.connect.pool.maxsize","6");
contextSource.setBaseEnvironmentProperties(environment);
return contextSource;
}
Ожидаемое поведение
Мы хотим, чтобы при работе с Spring Security был включен какой-либо механизм повторных попыток или функционал.
Фактическое поведение
После запуска Spring Boot, подключения LDAP и входа через мои учетные данные наш InfoSec сообщает, что повторных попыток не предпринимается, что приводит к исчерпанию наших ресурсов.