Search in sources :

Example 1 with LdapAcceptableUsagePolicyRepository

use of org.apereo.cas.web.flow.LdapAcceptableUsagePolicyRepository in project cas by apereo.

the class CasSupportActionsAcceptableUsagePolicyLdapConfiguration method acceptableUsagePolicyRepository.

@RefreshScope
@Bean
public AcceptableUsagePolicyRepository acceptableUsagePolicyRepository() {
    final AcceptableUsagePolicyProperties.Ldap ldap = casProperties.getAcceptableUsagePolicy().getLdap();
    final ConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(ldap);
    final LdapAcceptableUsagePolicyRepository r = new LdapAcceptableUsagePolicyRepository(ticketRegistrySupport, connectionFactory, ldap.getUserFilter(), ldap.getBaseDn());
    r.setAupAttributeName(casProperties.getAcceptableUsagePolicy().getAupAttributeName());
    return r;
}
Also used : ConnectionFactory(org.ldaptive.ConnectionFactory) LdapAcceptableUsagePolicyRepository(org.apereo.cas.web.flow.LdapAcceptableUsagePolicyRepository) AcceptableUsagePolicyProperties(org.apereo.cas.configuration.model.support.aup.AcceptableUsagePolicyProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Aggregations

AcceptableUsagePolicyProperties (org.apereo.cas.configuration.model.support.aup.AcceptableUsagePolicyProperties)1 LdapAcceptableUsagePolicyRepository (org.apereo.cas.web.flow.LdapAcceptableUsagePolicyRepository)1 ConnectionFactory (org.ldaptive.ConnectionFactory)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 Bean (org.springframework.context.annotation.Bean)1