Good day everybody.
I am facing a problem on Apereo CAS 5.0.1, and after trying for an entire day to look for a solution by myself I decided to ask some help from the community.
Oh, I am completely new to CAS, having started experimenting with this technology no more than 7 days ago, so I hope to be able to describe the problem scenario using the correct terminology...
I am currently trying to setup a lab-environment to provide SSO for a Spring Boot web application (as CAS Client), authenticating through CAS3 protocol on the Apereo CAS v.5.0.1
I have correctly configured the CAS Server to use an Apache Directory Server (v. 2.0.4) as authentication back-end for users.
After some research on internet and several attempts I was able to configure my security configuration class interfacing to the CAS (you can see down here a small excerpt):
@Configuration
@EnableWebSecurity
public class SecurityAccessConfiguration extends WebSecurityConfigurerAdapter {
private static final String[] PUBLIC_URLS = {
"/",
"/css/**",
"/fonts/**",
"/js/**",
"/images/**" };
private static final String[] ADMIN_ONLY_URLS = {};
private static final String[] AUTHENTICATED_ONLY_URLS = {};
@Bean
public ServiceProperties serviceProperties() {
ServiceProperties serviceProperties = new ServiceProperties();
serviceProperties.setSendRenew(false);
return serviceProperties;
}
@Bean
public CasAuthenticationProvider casAuthenticationProvider() {
CasAuthenticationProvider casAuthenticationProvider = new CasAuthenticationProvider();
casAuthenticationProvider.setAuthenticationUserDetailsService(authenticationUserDetailsService());
casAuthenticationProvider.setServiceProperties(serviceProperties());
casAuthenticationProvider.setTicketValidator(cas30ServiceTicketValidator());
casAuthenticationProvider.setKey("tako_client");
return casAuthenticationProvider;
}
@Bean
public AuthenticationUserDetailsService authenticationUserDetailsService() {
return new UserDetailsServiceImpl();
}
@Bean
public Cas30ServiceTicketValidator cas30ServiceTicketValidator() {
}
@Bean
public CasAuthenticationFilter casAuthenticationFilter() throws Exception {
CasAuthenticationFilter casAuthenticationFilter = new CasAuthenticationFilter();
casAuthenticationFilter.setAuthenticationManager(authenticationManager());
return casAuthenticationFilter;
}
@Bean
public CasAuthenticationEntryPoint casAuthenticationEntryPoint() {
CasAuthenticationEntryPoint casAuthenticationEntryPoint = new CasAuthenticationEntryPoint();
casAuthenticationEntryPoint.setServiceProperties(serviceProperties());
return casAuthenticationEntryPoint;
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.addFilter(casAuthenticationFilter()).exceptionHandling().authenticationEntryPoint(casAuthenticationEntryPoint())
.and().csrf().disable().cors().disable()
.authorizeRequests().antMatchers(PUBLIC_URLS).anonymous()
.and()
.authorizeRequests().anyRequest().authenticated();
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(casAuthenticationProvider());
}
}
Now, everything seems to be working fine: I visit the homepage of my app, and when I click any other link on the page I am redirected to the login page of the CAS;
from there I login with the username and password of the user stored on the Apache Directory Server and I am redirected on my web application homepage. Below you can see that the CAS is passing me back the TGT as part of the URL:

...But that's it unfortunately. Every time I try to click on any other link on the home page, I am just redirected to the homepage again, and the homepage URL shows each time a different ticket number each time I try to click a new link.
I attach another screenshot down here another screenshot with the network calls trace from Chrome developer tools:

Can anybody explain me where I am getting it wrong? Is it some wrong parameter in my Spring Boot configuration? Or maybe I should modify something in the configuration of the CAS server itself?
I thank you in advance for your support.
J.B.