@Bean
        @ConditionalOnMissingBean(name = MessageSanitizer.BEAN_NAME)
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public MessageSanitizer messageSanitizer(final List<MessageSanitationContributor> contributors) {
            val prefixes = contributors
                .stream()
                .map(MessageSanitationContributor::getTicketIdentifierPrefixes)
                .filter(Objects::nonNull)
                .flatMap(List::stream)
                .collect(Collectors.joining("|"));
            val pattern = Pattern.compile("(?:(?:" + prefixes + ")-\\d+-)([\\w.-]+)");
            return new DefaultMessageSanitizer(pattern);
        }
Create casBeanValidationPostProcessor bean.
Note that {@code BeanPostProcessor} beans should be static.

@return the BeanValidationPostProcessor
core/cas-server-core-util/src/main/java/org/apereo/cas/config/CasCoreUtilConfiguration.java