use of org.springframework.context.annotation.Bean in project cas by apereo.
the class EhcacheTicketRegistryConfiguration method cacheManager.
@Lazy
@Bean
public EhCacheManagerFactoryBean cacheManager() {
final EhcacheProperties cache = casProperties.getTicket().getRegistry().getEhcache();
final EhCacheManagerFactoryBean bean = new EhCacheManagerFactoryBean();
bean.setConfigLocation(cache.getConfigLocation());
bean.setShared(cache.isShared());
bean.setCacheManagerName(cache.getCacheManagerName());
return bean;
}
use of org.springframework.context.annotation.Bean in project cas by apereo.
the class ElectronicFenceConfiguration method authenticationRiskEvaluator.
@ConditionalOnMissingBean(name = "authenticationRiskEvaluator")
@Bean
@RefreshScope
public AuthenticationRiskEvaluator authenticationRiskEvaluator() {
final RiskBasedAuthenticationProperties risk = casProperties.getAuthn().getAdaptive().getRisk();
final Set<AuthenticationRequestRiskCalculator> calculators = new HashSet<>();
if (risk.getIp().isEnabled()) {
calculators.add(ipAddressAuthenticationRequestRiskCalculator());
}
if (risk.getAgent().isEnabled()) {
calculators.add(userAgentAuthenticationRequestRiskCalculator());
}
if (risk.getDateTime().isEnabled()) {
calculators.add(dateTimeAuthenticationRequestRiskCalculator());
}
if (risk.getGeoLocation().isEnabled()) {
calculators.add(geoLocationAuthenticationRequestRiskCalculator());
}
if (calculators.isEmpty()) {
LOGGER.warn("No risk calculators are defined to examine authentication requests");
}
return new DefaultAuthenticationRiskEvaluator(calculators);
}
use of org.springframework.context.annotation.Bean in project cas by apereo.
the class ElectronicFenceConfiguration method blockAuthenticationContingencyPlan.
@ConditionalOnMissingBean(name = "blockAuthenticationContingencyPlan")
@Bean
@RefreshScope
public AuthenticationRiskContingencyPlan blockAuthenticationContingencyPlan() {
final BlockAuthenticationContingencyPlan b = new BlockAuthenticationContingencyPlan();
configureContingencyPlan(b);
return b;
}
use of org.springframework.context.annotation.Bean in project cas by apereo.
the class GrouperMultifactorAuthenticationConfiguration method grouperMultifactorAuthenticationWebflowEventResolver.
@Bean
@RefreshScope
public CasWebflowEventResolver grouperMultifactorAuthenticationWebflowEventResolver() {
final AbstractCasWebflowEventResolver r;
if (StringUtils.isNotBlank(casProperties.getAuthn().getMfa().getGrouperGroupField())) {
r = new GrouperMultifactorAuthenticationPolicyEventResolver(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator, authenticationRequestServiceSelectionStrategies, multifactorAuthenticationProviderSelector, casProperties);
LOGGER.debug("Activating MFA event resolver based on Grouper groups...");
} else {
r = new NoOpCasWebflowEventResolver(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator, authenticationRequestServiceSelectionStrategies, multifactorAuthenticationProviderSelector);
}
return r;
}
use of org.springframework.context.annotation.Bean in project cas by apereo.
the class LdapServiceRegistryConfiguration method serviceRegistryDao.
@Bean
@RefreshScope
@Autowired
public ServiceRegistryDao serviceRegistryDao(@Qualifier("ldapServiceRegistryMapper") final LdapRegisteredServiceMapper mapper) {
final LdapServiceRegistryProperties ldap = casProperties.getServiceRegistry().getLdap();
final ConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(ldap);
return new LdapServiceRegistryDao(connectionFactory, ldap.getBaseDn(), mapper, ldap);
}
Aggregations