@Bean
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @ConditionalOnMissingBean(name = "duoSecurityComponentSerializationPlanConfigurer")
    public ComponentSerializationPlanConfigurer duoSecurityComponentSerializationPlanConfigurer(
        final ConfigurableApplicationContext applicationContext) {
        return BeanSupplier.of(ComponentSerializationPlanConfigurer.class)
            .when(DuoSecurityAuthenticationService.CONDITION.given(applicationContext.getEnvironment()))
            .supply(() -> plan -> {
                plan.registerSerializableClass(DuoSecurityUniversalPromptCredential.class);
                plan.registerSerializableClass(DuoSecurityDirectCredential.class);
            })
            .otherwiseProxy()
            .get();
    }
This is {@link DuoSecurityComponentSerializationConfiguration}.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-duo/src/main/java/org/apereo/cas/config/DuoSecurityComponentSerializationConfiguration.java