@Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        @Lazy(false)
        @ConditionalOnMissingBean(name = "samlIdPCasEventListener")
        public CasApplicationReadyListener samlIdPCasEventListener(
            @Qualifier(SamlIdPMetadataGenerator.BEAN_NAME)
            final SamlIdPMetadataGenerator samlIdPMetadataGenerator) {
            return event -> {
                val document = FunctionUtils.doAndHandle(() -> {
                    LOGGER.debug("Attempting to generate/fetch SAML IdP metadata...");
                    return samlIdPMetadataGenerator.generate(Optional.empty());
                }, e -> {
                    LoggingUtils.error(LOGGER, e);
                    return null;
                }).get();
                LOGGER.trace("Generated SAML IdP metadata document is [{}]", document);
            };
        }
This is {@link SamlIdPMetadataConfiguration}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-saml-idp/src/main/java/org/apereo/cas/config/SamlIdPMetadataConfiguration.java