@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @Bean
    @ConditionalOnMissingBean(name = "ldapPasswordChangeService")
    public PasswordManagementService passwordChangeService(
        final ConfigurableApplicationContext applicationContext,
        final CasConfigurationProperties casProperties,
        @Qualifier("passwordManagementCipherExecutor")
        final CipherExecutor passwordManagementCipherExecutor,
        @Qualifier(PasswordHistoryService.BEAN_NAME)
        final PasswordHistoryService passwordHistoryService) {
        return BeanSupplier.of(PasswordManagementService.class)
            .when(CONDITION.given(applicationContext.getEnvironment()))
            .supply(() -> {
                val connectionFactoryMap = new ConcurrentHashMap<String, ConnectionFactory>();
                val passwordManagerProperties = casProperties.getAuthn().getPm();
                passwordManagerProperties.getLdap().forEach(
                    ldap -> connectionFactoryMap.put(ldap.getLdapUrl(), LdapUtils.newLdaptiveConnectionFactory(ldap)));
                return new LdapPasswordManagementService(passwordManagementCipherExecutor,
                    casProperties, passwordHistoryService, connectionFactoryMap);
            })
            .otherwise(() -> new NoOpPasswordManagementService(passwordManagementCipherExecutor, casProperties))
            .get();
    }
This is {@link CasLdapPasswordManagementAutoConfiguration}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-pm-ldap/src/main/java/org/apereo/cas/config/CasLdapPasswordManagementAutoConfiguration.java