jasig cas too many redirects issue

为君一笑 提交于 2019-12-30 13:35:17

问题


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:


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!



来源:https://stackoverflow.com/questions/35135360/jasig-cas-too-many-redirects-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!