package org.jeecg.modules.cas.util;

import org.jasig.cas.client.boot.configuration.CasClientConfigurer;
import org.jasig.cas.client.boot.configuration.EnableCasClient;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableCasClient
public class CasAuthConfig implements CasClientConfigurer  {

    @Override
    public void configureAuthenticationFilter(FilterRegistrationBean authenticationFilter) {
        authenticationFilter.getInitParameters().put("authenticationRedirectStrategyClass", CustomAuthRedirectStrategy.class.getName());
        authenticationFilter.getInitParameters().put("ignorePattern", "/|/sys/cas/client/validateLogin*|/sys/cas/client/redirect*|/index.html|/*.png|/*.js");
    }
    @Override
    public void configureValidationFilter(FilterRegistrationBean validationFilter) {
        validationFilter.getInitParameters().put("encoding", "GBK");
    }
}
