@Bean
        @ConditionalOnMissingBean(name = "casRequestHeaderAuthenticationFilter")
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public FilterRegistrationBean<RequestHeaderAuthenticationFilter> casRequestHeaderAuthenticationFilter(
            final CasConfigurationProperties casProperties) {
            val valve = casProperties.getServer().getTomcat().getRemoteUserValve();
            val filter = new RequestHeaderAuthenticationFilter();
            filter.setPrincipalRequestHeader(StringUtils.defaultIfBlank(valve.getRemoteUserHeader(), "NA"));
            filter.setExceptionIfHeaderMissing(false);
            filter.setRequiresAuthenticationRequestMatcher(request -> RegexUtils.matchesIpAddress(valve.getAllowedIpAddressRegex(), request.getRemoteAddr()));
            filter.setAuthenticationManager(authentication -> {
                authentication.setAuthenticated(authentication.getPrincipal() != null);
                return authentication;
            });
            val bean = new FilterRegistrationBean<>(filter);
            bean.setName("casRequestHeaderAuthenticationFilter");
            bean.setAsyncSupported(true);
            bean.setOrder(0);
            bean.setEnabled(StringUtils.isNotBlank(valve.getRemoteUserHeader()));
            return bean;
        }
This is {@link CasTrustedAuthenticationWebflowAutoConfiguration}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-trusted-webflow/src/main/java/org/apereo/cas/config/CasTrustedAuthenticationWebflowAutoConfiguration.java