0

I'm trying to secure a spring-boot web application using spring security and spring-security-cas (SSO with Jasig CAS).

I'm facing a too many redirects error when trying to access a protected resources. The project is available here

Do you see any error in my configuration?

Thanks in advance

redirect loop error screenshot

IKane
  • 275
  • 2
  • 8
  • 17

1 Answers1

4

Finally found out the error:

In SpringSecurity 4.x, CasAuthenticationFilter's defaultFilterProcessesUrl path is changed. So Change '/j_spring_cas_security_check' to '/login/cas' in Configuration.

So in my application.properties file, i had to change

app.service.security=http://localhost:7777/j_spring_cas_security_check

to

app.service.security=http://localhost:7777/login/cas

So the ServiceProperties Bean would become

   @Bean
    public ServiceProperties serviceProperties() {
        ServiceProperties serviceProperties = new ServiceProperties();
        serviceProperties.setService("http://localhost:7777/login/cas");
        serviceProperties.setSendRenew(false);
        return serviceProperties;
    }

Hope it'll help someone else!

IKane
  • 275
  • 2
  • 8
  • 17
  • 1
    Are you running cas-server locally on port 7777? Or does your application implement something at /login/cas? I'm really struggling to get my app working with CAS. – Marvo Feb 08 '19 at 19:00