• 大小: 68KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-14
  • 语言: Java
  • 标签: 开源  

资源简介

cas-client-autoconfig-support, Apereo Java客户端支持基于注释的配置 cas-client-autoconfig-support 为CAS Java客户端提供基于注释的配置支持的库,这个项目是作为Unicon的开源支持程序的一部

资源截图

代码片段和文件信息

package net.unicon.cas.client.configuration;

import org.jasig.cas.client.authentication.AuthenticationFilter;
import org.jasig.cas.client.authentication.Saml11AuthenticationFilter;
import org.jasig.cas.client.util.AssertionThreadLocalFilter;
import org.jasig.cas.client.util.HttpServletRequestWrapperFilter;
import org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter;
import org.jasig.cas.client.validation.Cas30ProxyReceivingTicketValidationFilter;
import org.jasig.cas.client.validation.Saml11TicketValidationFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;

import javax.servlet.Filter;

import static net.unicon.cas.client.configuration.EnableCasClient.ValidationType.CAS;
import static net.unicon.cas.client.configuration.EnableCasClient.ValidationType.CAS3;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Configuration class providing default CAS client infrastructure filters.
 * This configuration facility is typically imported into Spring‘s Application Context via
 * {@link net.unicon.cas.client.configuration.EnableCasClient EnableCasClient} meta annotation.
 *
 * @author Dmitriy Kopylenko
 * @see net.unicon.cas.client.configuration.EnableCasClient
 * @since 1.0.0
 */
@Configuration
@EnableConfigurationProperties(CasClientConfigurationProperties.class)
public class CasClientConfiguration {

    @Autowired
    CasClientConfigurationProperties configProps;

    private CasClientConfigurer casClientConfigurer;

    @Bean
    @ConditionalOnProperty(prefix = “cas“ name = “skipTicketValidation“ havingValue = “false“ matchIfMissing = true)
    public FilterRegistrationBean casValidationFilter() {
        final FilterRegistrationBean validationFilter = new FilterRegistrationBean();
        final Filter targetCasValidationFilter;
        switch (this.configProps.getValidationType()) {
            case CAS:
                targetCasValidationFilter = new Cas20ProxyReceivingTicketValidationFilter();
                break;
            case CAS3:
                targetCasValidationFilter = new Cas30ProxyReceivingTicketValidationFilter();
                break;
            case SAML:
                targetCasValidationFilter = new Saml11TicketValidationFilter();
                break;
            default:
                throw new IllegalStateException(“Unknown CAS validation type“);
        }

        initFilter(validationFilter
                targetCasValidationFilter
                1
                constructInitParams(“

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-05-13 13:50  cas-client-autoconfig-support-master\
     文件         127  2019-05-13 13:50  cas-client-autoconfig-support-master\.gitignore
     文件       11325  2019-05-13 13:50  cas-client-autoconfig-support-master\LICENSE
     文件        3282  2019-05-13 13:50  cas-client-autoconfig-support-master\README.md
     文件        3468  2019-05-13 13:50  cas-client-autoconfig-support-master\build.gradle
     文件        1429  2019-05-13 13:50  cas-client-autoconfig-support-master\changelog.txt
     文件         391  2019-05-13 13:50  cas-client-autoconfig-support-master\gradle.properties
     目录           0  2019-05-13 13:50  cas-client-autoconfig-support-master\gradle\
     目录           0  2019-05-13 13:50  cas-client-autoconfig-support-master\gradle\wrapper\
     文件       54413  2019-05-13 13:50  cas-client-autoconfig-support-master\gradle\wrapper\gradle-wrapper.jar
     文件         233  2019-05-13 13:50  cas-client-autoconfig-support-master\gradle\wrapper\gradle-wrapper.properties
     文件        5296  2019-05-13 13:50  cas-client-autoconfig-support-master\gradlew
     文件        2260  2019-05-13 13:50  cas-client-autoconfig-support-master\gradlew.bat
     目录           0  2019-05-13 13:50  cas-client-autoconfig-support-master\src\
     目录           0  2019-05-13 13:50  cas-client-autoconfig-support-master\src\main\
     目录           0  2019-05-13 13:50  cas-client-autoconfig-support-master\src\main\java\
     目录           0  2019-05-13 13:50  cas-client-autoconfig-support-master\src\main\java\net\
     目录           0  2019-05-13 13:50  cas-client-autoconfig-support-master\src\main\java\net\unicon\
     目录           0  2019-05-13 13:50  cas-client-autoconfig-support-master\src\main\java\net\unicon\cas\
     目录           0  2019-05-13 13:50  cas-client-autoconfig-support-master\src\main\java\net\unicon\cas\client\
     目录           0  2019-05-13 13:50  cas-client-autoconfig-support-master\src\main\java\net\unicon\cas\client\configuration\
     文件        8534  2019-05-13 13:50  cas-client-autoconfig-support-master\src\main\java\net\unicon\cas\client\configuration\CasClientConfiguration.java
     文件        6396  2019-05-13 13:50  cas-client-autoconfig-support-master\src\main\java\net\unicon\cas\client\configuration\CasClientConfigurationProperties.java
     文件        1690  2019-05-13 13:50  cas-client-autoconfig-support-master\src\main\java\net\unicon\cas\client\configuration\CasClientConfigurer.java
     文件        1339  2019-05-13 13:50  cas-client-autoconfig-support-master\src\main\java\net\unicon\cas\client\configuration\CasClientConfigurerAdapter.java
     文件        1480  2019-05-13 13:50  cas-client-autoconfig-support-master\src\main\java\net\unicon\cas\client\configuration\EnableCasClient.java

评论

共有 条评论