Я использую OpenDJ и установил return-bind-error-messages в true.Получение статуса блокировки от LDAP с помощью Spring
Мой код выглядит следующим образом
BindAuthenticator authenticator = new BindAuthenticator(contextSource);
authenticator.setUserSearch(new FilterBasedLdapUserSearch(
searchBase,
new EqualsFilter("uid", username).encode(),
contextSource));
try {
authenticator.authenticate(new UsernamePasswordAuthenticationToken(
username,
authentication.getCredentials(),
authentication.getAuthorities()
));
} catch (NameNotFoundException e) {
loginService.auditAuthentication(usernameWithDomainString,false,0,userDetails.getRemoteAddress());
return null;
} catch (RuntimeException e) {
throw e;
}
е типа org.springframework.security.authentication.BadCredentialsException: Неверные учетные данные, когда пользователь был заблокирован.
Также я получаю следующее в журнале LDAP:
"[17/Sep/2013:15:44:13 -0400] BIND RES conn=106 op=0 msgID=1 result=49 message="R
ejecting a bind request for user uid=doctor.uno,ou=people,dc=example,dc=com becaus
e the account has been locked due to too many failed authentication attempts" et
ime=1"
Как я получаю информацию о том, что неудачная попытка Войти был из-за локаута с весной?