jasig cas too many redirects issue

2019-02-21 00:10发布

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

1条回答
劳资没心,怎么记你
2楼-- · 2019-02-21 01:10

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!

查看更多
登录 后发表回答