JHipster限制登录尝试getDetails = null

时间:2018-07-28 17:08:17

标签: spring jhipster

我想限制登录尝试。因此,我创建了一个事件监听器:

@Component
public class AuthenticationFailureEventListener implements ApplicationListener<AuthenticationFailureBadCredentialsEvent> {

@Autowired
private LoginAttemptService loginAttemptService;

public void onApplicationEvent(AuthenticationFailureBadCredentialsEvent event) {
    WebAuthenticationDetails webAuthenticationDetails = (WebAuthenticationDetails) event.getAuthentication().getDetails();

    loginAttemptService.loginFailed(webAuthenticationDetails.getRemoteAddress());
}

}

每次尝试登录时,都会得到一个空指针异常。 enter image description here

我正在将JHipster与JWT令牌一起使用

0 个答案:

没有答案