@Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public FactoryBean<EntityManagerFactory> passwordHistoryEntityManagerFactory(
            final ConfigurableApplicationContext applicationContext,
            final CasConfigurationProperties casProperties,
            @Qualifier("jpaPasswordHistoryVendorAdapter")
            final JpaVendorAdapter jpaPasswordHistoryVendorAdapter,
            @Qualifier("jpaPasswordHistoryPackagesToScan")
            final BeanContainer<String> jpaPasswordHistoryPackagesToScan,
            @Qualifier("jdbcPasswordManagementDataSource")
            final DataSource jdbcPasswordManagementDataSource,
            @Qualifier(JpaBeanFactory.DEFAULT_BEAN_NAME)
            final JpaBeanFactory jpaBeanFactory) {
            return BeanSupplier.of(FactoryBean.class)
                .when(CONDITION.given(applicationContext.getEnvironment()))
                .supply(Unchecked.supplier(() -> {
                    val ctx = JpaConfigurationContext.builder()
                        .jpaVendorAdapter(jpaPasswordHistoryVendorAdapter)
                        .persistenceUnitName("jpaPasswordHistoryContext")
                        .dataSource(jdbcPasswordManagementDataSource)
                        .packagesToScan(jpaPasswordHistoryPackagesToScan.toSet()).build();
                    return jpaBeanFactory.newEntityManagerFactoryBean(ctx,
                        casProperties.getAuthn().getPm().getJdbc());
                }))
                .otherwiseProxy()
                .get();
        }
This is {@link JdbcPasswordHistoryManagementConfiguration}.

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