springboot使用cas認證

引入pom

<dependency>
            <groupId>net.unicon.cas</groupId>
            <artifactId>cas-client-autoconfig-support</artifactId>
            <version>1.2.0-GA</version>
        </dependency>

java config

@Configuration
@EnableCasClient
public class CasConfig extends CasClientConfigurerAdapter{

    @Override
    public void configureAuthenticationFilter(FilterRegistrationBean authenticationFilter) {
        super.configureAuthenticationFilter(authenticationFilter);
        authenticationFilter.getInitParameters().put("authenticationRedirectStrategyClass", "com.codecraft.CustomAuthRedirectStrategy");
    }
}

其中authenticationRedirectStrategyClass能夠用來指定自定義的redirect策略。java

application.yaml

cas:
  server-url-prefix: http://192.168.99.100:9090/cas
  server-login-url: http://192.168.99.100:9090/cas/login
  client-host-url: http://localhost:8080
  validation-type: CAS

doc

相關文章
相關標籤/搜索