Creating the CasAuthenticationFilter bean is quite straightforward, as we just assign the serviceProperties that we created to the CasAuthenticationFilter:
@Bean
public CasAuthenticationFilter casAuthenticationFilter(ServiceProperties serviceProperties) throws Exception {
CasAuthenticationFilter filter = new CasAuthenticationFilter();
filter.setServiceProperties(serviceProperties);
filter.setAuthenticationManager(authenticationManager());
return filter;
}