| | |
| | | retryCount = new AtomicInteger(0); |
| | | passwordRetryCache.put(username, retryCount); |
| | | } |
| | | if(retryCount.incrementAndGet() > 5) { |
| | | if(retryCount.incrementAndGet() > 8) { |
| | | //if retry count > 5 throw |
| | | logger.warn("username: " + username + " tried to login more than 5 times in period"); |
| | | logger.warn("username: " + username + " tried to login more than 8 times in period"); |
| | | // FacesUtils.warn("用户名: " + username + " 密码连续输入错误超过5次,锁定5分钟!"); |
| | | throw new ExcessiveAttemptsException("用户名: " + username + " 密码连续输入错误超过5次,锁定5分钟!"); |
| | | throw new ExcessiveAttemptsException("用户名: " + username + " 密码连续输入错误超过8次,锁定1分钟!"); |
| | | } |
| | | |
| | | boolean matches = super.doCredentialsMatch(authcToken, info); |