如何使用 appfoundation 获取失败的登录尝试?它有一个函数 getFailedLoginAttempts() 但它没有任何意义。我正在使用 Vaadin 6 (6.8.12)
我的代码在这里:
NativeButton login = new NativeButton(Lang.getMessage("login"), new ClickListener() {
private static final long serialVersionUID = -5577423546946890721L;
public void buttonClick(ClickEvent event) {
username = (String) usernameField.getValue();
String password = (String) passwordField.getValue();
try {
AuthenticationUtil.authenticate(username, password);
startApp();
} catch (InvalidCredentialsException e) {
/* I need to get failed login attempts here but how can I do that?
I just can by doing this: AuthenticationUtil.authenticate(username, password).
getFailedLoginAttempts(), but I need to write try and catch blocks
(so try and catch blocks in catch block) for authenticate method and this
function will never work, because user won't be authenticated and all
the time you will go to the other catch block; */
feedbackLabel.setValue(Lang.getMessage("usernameOrPasswordIncorect"));
} catch (AccountLockedException e) {
feedbackLabel.setValue(Lang.getMessage("accountBlocked"));
}
}
});
我在评论中写了所有问题。我想打印一些失败的登录尝试,但无法获得这个数字。有什么建议么?