Search in sources :

Example 21 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project ocvn by devgateway.

the class WebSecurityConfig method configureGlobal.

@Autowired
public void configureGlobal(final AuthenticationManagerBuilder auth) throws Exception {
    // we use standard password encoder for all passwords
    StandardPasswordEncoder spe = new StandardPasswordEncoder();
    auth.userDetailsService(customJPAUserDetailsService).passwordEncoder(spe);
}
Also used : StandardPasswordEncoder(org.springframework.security.crypto.password.StandardPasswordEncoder) Autowired(org.springframework.beans.factory.annotation.Autowired)

Example 22 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 23 with Autowired

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

the class JpaServiceRegistryConfiguration method transactionManagerServiceReg.

@Autowired
@Bean
public PlatformTransactionManager transactionManagerServiceReg(@Qualifier("serviceEntityManagerFactory") final EntityManagerFactory emf) {
    final JpaTransactionManager mgmr = new JpaTransactionManager();
    mgmr.setEntityManagerFactory(emf);
    return mgmr;
}
Also used : JpaTransactionManager(org.springframework.orm.jpa.JpaTransactionManager) Autowired(org.springframework.beans.factory.annotation.Autowired) Beans.newHibernateEntityManagerFactoryBean(org.apereo.cas.configuration.support.Beans.newHibernateEntityManagerFactoryBean) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

Example 24 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 25 with Autowired

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

the class OpenIdConfiguration method openIdPostUrlHandlerMapping.

@Autowired
@Bean
public OpenIdPostUrlHandlerMapping openIdPostUrlHandlerMapping(@Qualifier("argumentExtractor") final ArgumentExtractor argumentExtractor) {
    final OpenIdValidateController c = new OpenIdValidateController(serverManager());
    c.setValidationSpecification(this.cas20WithoutProxyProtocolValidationSpecification);
    c.setSuccessView(casOpenIdServiceSuccessView);
    c.setFailureView(casOpenIdServiceFailureView);
    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());
    final DelegatingController controller = new DelegatingController();
    controller.setDelegates(Arrays.asList(smartOpenIdAssociationController(), c));
    final OpenIdPostUrlHandlerMapping m = new OpenIdPostUrlHandlerMapping();
    m.setOrder(1);
    final Properties mappings = new Properties();
    mappings.put("/login", controller);
    m.setMappings(mappings);
    return m;
}
Also used : OpenIdValidateController(org.apereo.cas.support.openid.web.mvc.OpenIdValidateController) DelegatingController(org.apereo.cas.web.DelegatingController) OpenIdPostUrlHandlerMapping(org.apereo.cas.support.openid.web.support.OpenIdPostUrlHandlerMapping) CasConfigurationProperties(org.apereo.cas.configuration.CasConfigurationProperties) EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) Properties(java.util.Properties) Autowired(org.springframework.beans.factory.annotation.Autowired) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

Autowired (org.springframework.beans.factory.annotation.Autowired)38 Bean (org.springframework.context.annotation.Bean)23 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)9 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)5 JpaTransactionManager (org.springframework.orm.jpa.JpaTransactionManager)3 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)3 V3ProxyValidateController (org.apereo.cas.web.v3.V3ProxyValidateController)2 V3ServiceValidateController (org.apereo.cas.web.v3.V3ServiceValidateController)2 Logger (org.slf4j.Logger)2 Qualifier (org.springframework.beans.factory.annotation.Qualifier)2 File (java.io.File)1 Constructor (java.lang.reflect.Constructor)1 Executable (java.lang.reflect.Executable)1 Field (java.lang.reflect.Field)1 Parameter (java.lang.reflect.Parameter)1 Properties (java.util.Properties)1 Resource (javax.annotation.Resource)1 Inject (javax.inject.Inject)1 PersistenceConfiguration (net.sf.ehcache.config.PersistenceConfiguration)1 CacheEntryFactory (net.sf.ehcache.constructs.blocking.CacheEntryFactory)1