Search in sources :

Example 1 with CouchbaseAuthenticationProperties

use of org.apereo.cas.configuration.model.support.couchbase.authentication.CouchbaseAuthenticationProperties in project cas by apereo.

the class CouchbaseAuthenticationConfiguration method authenticationCouchbaseClientFactory.

@ConditionalOnMissingBean(name = "authenticationCouchbaseClientFactory")
@RefreshScope
@Bean
public CouchbaseClientFactory authenticationCouchbaseClientFactory() {
    final CouchbaseAuthenticationProperties couchbase = casProperties.getAuthn().getCouchbase();
    final Set<String> nodes = org.springframework.util.StringUtils.commaDelimitedListToSet(couchbase.getNodeSet());
    return new CouchbaseClientFactory(nodes, couchbase.getBucket(), couchbase.getPassword());
}
Also used : CouchbaseClientFactory(org.apereo.cas.couchbase.core.CouchbaseClientFactory) CouchbaseAuthenticationProperties(org.apereo.cas.configuration.model.support.couchbase.authentication.CouchbaseAuthenticationProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with CouchbaseAuthenticationProperties

use of org.apereo.cas.configuration.model.support.couchbase.authentication.CouchbaseAuthenticationProperties in project cas by apereo.

the class CouchbaseAuthenticationConfiguration method couchbaseAuthenticationHandler.

@ConditionalOnMissingBean(name = "couchbaseAuthenticationHandler")
@Bean
@RefreshScope
public AuthenticationHandler couchbaseAuthenticationHandler() {
    final CouchbaseAuthenticationProperties couchbase = casProperties.getAuthn().getCouchbase();
    final CouchbaseAuthenticationHandler handler = new CouchbaseAuthenticationHandler(servicesManager, couchbasePrincipalFactory(), authenticationCouchbaseClientFactory(), couchbase);
    handler.setPrincipalNameTransformer(PrincipalNameTransformerUtils.newPrincipalNameTransformer(couchbase.getPrincipalTransformation()));
    handler.setPasswordEncoder(PasswordEncoderUtils.newPasswordEncoder(couchbase.getPasswordEncoder()));
    return handler;
}
Also used : CouchbaseAuthenticationHandler(org.apereo.cas.authentication.CouchbaseAuthenticationHandler) CouchbaseAuthenticationProperties(org.apereo.cas.configuration.model.support.couchbase.authentication.CouchbaseAuthenticationProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

CouchbaseAuthenticationProperties (org.apereo.cas.configuration.model.support.couchbase.authentication.CouchbaseAuthenticationProperties)2 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)2 Bean (org.springframework.context.annotation.Bean)2 CouchbaseAuthenticationHandler (org.apereo.cas.authentication.CouchbaseAuthenticationHandler)1 CouchbaseClientFactory (org.apereo.cas.couchbase.core.CouchbaseClientFactory)1