org.apereo.cas.config.DelegatedAuthenticationSerializationConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cas-server-support-pac4j-webflow Show documentation
Show all versions of cas-server-support-pac4j-webflow Show documentation
cas-server-support-pac4j-webflow
The newest version!
package org.apereo.cas.config;
import org.apereo.cas.authentication.principal.ClientCredential;
import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.configuration.features.CasFeatureModule;
import org.apereo.cas.util.serialization.ComponentSerializationPlanConfigurer;
import org.apereo.cas.util.spring.boot.ConditionalOnFeatureEnabled;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ScopedProxyMode;
/**
* This is {@link DelegatedAuthenticationSerializationConfiguration}.
*
* @author Misagh Moayyed
* @since 6.0.0
*/
@EnableConfigurationProperties(CasConfigurationProperties.class)
@ConditionalOnFeatureEnabled(feature = CasFeatureModule.FeatureCatalog.DelegatedAuthentication)
@Configuration(value = "DelegatedAuthenticationSerializationConfiguration", proxyBeanMethods = false)
class DelegatedAuthenticationSerializationConfiguration {
@Bean
@ConditionalOnMissingBean(name = "pac4jComponentSerializationPlanConfigurer")
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public ComponentSerializationPlanConfigurer pac4jComponentSerializationPlanConfigurer() {
return plan -> plan.registerSerializableClass(ClientCredential.class);
}
}