@ConditionalOnMissingBean(name = "samlSelfSignedCertificateWriter")
        @Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public SamlIdPCertificateAndKeyWriter samlSelfSignedCertificateWriter(
            final CasConfigurationProperties casProperties) throws Exception {
            val properties = casProperties.getAuthn().getSamlIdp().getMetadata().getCore();
            val url = new URI(casProperties.getServer().getPrefix());
            val generator = new DefaultSamlIdPCertificateAndKeyWriter(url.getHost());
            generator.setUriSubjectAltNames(CollectionUtils.wrap(url.getHost().concat("/idp/metadata")));
            properties.setCertificateAlgorithm(properties.getCertificateAlgorithm());
            properties.setKeySize(properties.getKeySize());
            return generator;
        }
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