@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @Bean
    @ConditionalOnMissingBean(name = "tomcatAsyncRequestsFilter")
    public FilterRegistrationBean<RemoteAddrFilter> tomcatAsyncRequestsFilter(final CasConfigurationProperties casProperties) {
        val bean = new FilterRegistrationBean();
        val filter = new Filter() {
            @Override
            public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException {
                request.setAttribute(Globals.ASYNC_SUPPORTED_ATTR, true);
                chain.doFilter(request, response);
            }
        };
        bean.setFilter(filter);
        bean.setUrlPatterns(CollectionUtils.wrap("/*"));
        bean.setName("tomcatAsyncRequestsFilter");
        bean.setEnabled(true);
        bean.setAsyncSupported(true);
        bean.setOrder(Ordered.HIGHEST_PRECEDENCE + 1);
        return bean;
    }
This is {@link CasEmbeddedContainerTomcatFiltersConfiguration}.

@author Misagh Moayyed
@since 5.0.0
webapp/cas-server-webapp-init-tomcat/src/main/java/org/apereo/cas/config/CasEmbeddedContainerTomcatFiltersConfiguration.java