@ConditionalOnMissingBean(name = "oktaPersonDirectoryClient")
    @Bean
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    public Client oktaPersonDirectoryClient(
        final ConfigurableApplicationContext applicationContext,
        final CasConfigurationProperties casProperties) {
        return BeanSupplier.of(Client.class)
            .when(CONDITION.given(applicationContext.getEnvironment()))
            .supply(() -> {
                val properties = casProperties.getAuthn().getAttributeRepository().getOkta();
                return OktaConfigurationFactory.buildClient(properties);
            })
            .otherwiseProxy()
            .get();
    }
This is {@link OktaPersonDirectoryConfiguration}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-okta-authentication/src/main/java/org/apereo/cas/config/OktaPersonDirectoryConfiguration.java