Search in sources :

Example 41 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class SamlConfiguration method samlValidateController.

@Autowired
@Bean
public SamlValidateController samlValidateController(@Qualifier("argumentExtractor") final ArgumentExtractor argumentExtractor) {
    final SamlValidateController c = new SamlValidateController();
    c.setValidationSpecification(cas20WithoutProxyProtocolValidationSpecification);
    c.setSuccessView(casSamlServiceSuccessView());
    c.setFailureView(casSamlServiceFailureView());
    c.setProxyHandler(proxy20Handler);
    c.setAuthenticationSystemSupport(authenticationSystemSupport);
    c.setServicesManager(servicesManager);
    c.setCentralAuthenticationService(centralAuthenticationService);
    c.setArgumentExtractor(argumentExtractor);
    c.setMultifactorTriggerSelectionStrategy(multifactorTriggerSelectionStrategy);
    c.setAuthenticationContextValidator(authenticationContextValidator);
    c.setJsonView(cas3ServiceJsonView);
    c.setAuthnContextAttribute(casProperties.getAuthn().getMfa().getAuthenticationContextAttribute());
    return c;
}
Also used : SamlValidateController(org.apereo.cas.support.saml.web.SamlValidateController) Autowired(org.springframework.beans.factory.annotation.Autowired) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) OpenSamlConfigBean(org.apereo.cas.support.saml.OpenSamlConfigBean) Bean(org.springframework.context.annotation.Bean)

Example 42 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class CasCoreAuthenticationPrincipalConfiguration method personDirectoryPrincipalResolver.

@Autowired
@RefreshScope
@Bean
@ConditionalOnMissingBean(name = "personDirectoryPrincipalResolver")
public PrincipalResolver personDirectoryPrincipalResolver(@Qualifier("attributeRepository") final IPersonAttributeDao attributeRepository, @Qualifier("principalFactory") final PrincipalFactory principalFactory) {
    final PersonDirectoryPrincipalResolver bean = new PersonDirectoryPrincipalResolver();
    bean.setAttributeRepository(attributeRepository);
    bean.setPrincipalAttributeName(casProperties.getPersonDirectory().getPrincipalAttribute());
    bean.setReturnNullIfNoAttributes(casProperties.getPersonDirectory().isReturnNull());
    bean.setPrincipalFactory(principalFactory);
    return bean;
}
Also used : PersonDirectoryPrincipalResolver(org.apereo.cas.authentication.principal.resolvers.PersonDirectoryPrincipalResolver) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Autowired(org.springframework.beans.factory.annotation.Autowired) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 43 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class CasJdbcThrottlingConfiguration method authenticationThrottle.

@Autowired
@Bean
@RefreshScope
public ThrottledSubmissionHandlerInterceptor authenticationThrottle(@Qualifier("auditTrailManager") final AuditTrailManager auditTrailManager) {
    final ThrottleProperties throttle = casProperties.getAuthn().getThrottle();
    final String appcode = throttle.getAppcode();
    final String sqlQueryAudit = throttle.getJdbc().getAuditQuery();
    final ThrottleProperties.Failure failure = throttle.getFailure();
    return new InspektrThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapter(failure.getThreshold(), failure.getRangeSeconds(), throttle.getUsernameParameter(), auditTrailManager, inspektrAuditTrailDataSource(), appcode, sqlQueryAudit, failure.getCode());
}
Also used : InspektrThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapter(org.apereo.cas.web.support.InspektrThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapter) ThrottleProperties(org.apereo.cas.configuration.model.support.throttle.ThrottleProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Autowired(org.springframework.beans.factory.annotation.Autowired) Bean(org.springframework.context.annotation.Bean)

Example 44 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class MemcachedTicketRegistryConfiguration method ticketRegistry.

@Autowired
@Bean
public TicketRegistry ticketRegistry(@Qualifier("memcachedClient") final MemcachedClientIF memcachedClientIF) {
    final MemCacheTicketRegistry registry = new MemCacheTicketRegistry(memcachedClientIF);
    registry.setCipherExecutor(Beans.newTicketRegistryCipherExecutor(casProperties.getTicket().getRegistry().getMemcached().getCrypto()));
    return registry;
}
Also used : MemCacheTicketRegistry(org.apereo.cas.ticket.registry.MemCacheTicketRegistry) Autowired(org.springframework.beans.factory.annotation.Autowired) MemcachedClientFactoryBean(net.spy.memcached.spring.MemcachedClientFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 45 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class LdapMonitorConfiguration method pooledLdapConnectionFactoryMonitor.

@Autowired
@Bean
public Monitor pooledLdapConnectionFactoryMonitor(@Qualifier("pooledConnectionFactoryMonitorExecutorService") final ExecutorService executor) {
    final MonitorProperties.Ldap ldap = casProperties.getMonitor().getLdap();
    final PooledConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(ldap);
    return new PooledLdapConnectionFactoryMonitor(executor, Long.valueOf(ldap.getMaxWait()).intValue(), connectionFactory, new SearchValidator());
}
Also used : SearchValidator(org.ldaptive.pool.SearchValidator) PooledConnectionFactory(org.ldaptive.pool.PooledConnectionFactory) PooledLdapConnectionFactoryMonitor(org.apereo.cas.monitor.PooledLdapConnectionFactoryMonitor) MonitorProperties(org.apereo.cas.configuration.model.core.monitor.MonitorProperties) Autowired(org.springframework.beans.factory.annotation.Autowired) ThreadPoolExecutorFactoryBean(org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

Autowired (org.springframework.beans.factory.annotation.Autowired)68 Bean (org.springframework.context.annotation.Bean)49 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)24 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)16 JpaTransactionManager (org.springframework.orm.jpa.JpaTransactionManager)8 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)8 ThrottleProperties (org.apereo.cas.configuration.model.support.throttle.ThrottleProperties)4 OpenSamlConfigBean (org.apereo.cas.support.saml.OpenSamlConfigBean)3 Field (java.lang.reflect.Field)2 PersonDirectoryPrincipalResolver (org.apereo.cas.authentication.principal.resolvers.PersonDirectoryPrincipalResolver)2 MonitorProperties (org.apereo.cas.configuration.model.core.monitor.MonitorProperties)2 EncryptionRandomizedSigningJwtCryptographyProperties (org.apereo.cas.configuration.model.core.util.EncryptionRandomizedSigningJwtCryptographyProperties)2 DynamoDbTicketRegistryProperties (org.apereo.cas.configuration.model.support.dynamodb.DynamoDbTicketRegistryProperties)2 CasWebflowEventResolver (org.apereo.cas.web.flow.resolver.CasWebflowEventResolver)2 V3ServiceValidateController (org.apereo.cas.web.v3.V3ServiceValidateController)2 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)2 EhCacheFactoryBean (org.springframework.cache.ehcache.EhCacheFactoryBean)2 EhCacheManagerFactoryBean (org.springframework.cache.ehcache.EhCacheManagerFactoryBean)2 Lazy (org.springframework.context.annotation.Lazy)2 DeviceResponseMessageSender (com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.DeviceResponseMessageSender)1