use of org.apereo.cas.web.support.InMemoryThrottledSubmissionByIpAddressHandlerInterceptorAdapter in project cas by apereo.
the class CasThrottlingConfiguration method authenticationThrottle.
@RefreshScope
@ConditionalOnMissingBean(name = "authenticationThrottle")
@Bean
@Autowired
public ThrottledSubmissionHandlerInterceptor authenticationThrottle(@Qualifier("auditTrailExecutionPlan") final AuditTrailExecutionPlan auditTrailExecutionPlan) {
final ThrottleProperties throttle = casProperties.getAuthn().getThrottle();
if (StringUtils.isNotBlank(throttle.getUsernameParameter())) {
LOGGER.debug("Activating authentication throttling based on IP address and username...");
return new InMemoryThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapter(throttle.getFailure().getThreshold(), throttle.getFailure().getRangeSeconds(), throttle.getUsernameParameter(), throttle.getFailure().getCode(), auditTrailExecutionPlan, throttle.getAppcode());
}
LOGGER.debug("Activating authentication throttling based on IP address...");
return new InMemoryThrottledSubmissionByIpAddressHandlerInterceptorAdapter(throttle.getFailure().getThreshold(), throttle.getFailure().getRangeSeconds(), throttle.getUsernameParameter(), throttle.getFailure().getCode(), auditTrailExecutionPlan, throttle.getAppcode());
}
Aggregations