私は OpenDJ を使用しており、return-bind-error-messages を true に設定しています。
私のコードは次のようになります
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;
}
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"
Spring でのロックアウトが原因でログイン試行が失敗したという情報を取得するにはどうすればよいですか?