@Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        @ConditionalOnMissingBean(name = "discoveryProfileAvailableAttributes")
        public BeanContainer<String> discoveryProfileAvailableAttributes(
            final CasConfigurationProperties casProperties,
            @Qualifier(PrincipalResolver.BEAN_NAME_ATTRIBUTE_REPOSITORY) final ObjectProvider<PersonAttributeDao> attributeRepository) {

            val attributes = new LinkedHashSet<String>();
            attributeRepository.ifAvailable(repository -> {
                val possibleUserAttributeNames = repository.getPossibleUserAttributeNames(PersonAttributeDaoFilter.alwaysChoose());
                if (possibleUserAttributeNames != null) {
                    attributes.addAll(possibleUserAttributeNames);
                }
            });

            val ldapProps = casProperties.getAuthn().getLdap();
            if (ldapProps != null) {
                ldapProps.forEach(ldap -> {
                    attributes.addAll(transformAttributes(ldap.getPrincipalAttributeList()));
                    attributes.addAll(transformAttributes(ldap.getAdditionalAttributes()));
                });
            }
            val jdbcProps = casProperties.getAuthn().getJdbc();
            if (jdbcProps != null) {
                jdbcProps.getQuery().forEach(jdbc -> attributes.addAll(transformAttributes(jdbc.getPrincipalAttributeList())));
            }
            return BeanContainer.of(attributes);
        }
This is {@link CasDiscoveryProfileAutoConfiguration}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-discovery-profile/src/main/java/org/apereo/cas/config/CasDiscoveryProfileAutoConfiguration.java