spring系列---CAS客户端与SpringSecurity集成

CAS客户端与SpringSecurity集成

  • pom.xml

            org.springframework
            spring-context
            4.3.9.RELEASE
        
        
            org.springframework
            spring-core
            4.3.9.RELEASE
        

        
        
            org.jasig.cas.client
            cas-client-core
            3.3.3
        
        
            javax.servlet
            servlet-api
            2.5
            provided
        
        
        
            org.springframework.security
            spring-security-cas
            4.1.0.RELEASE
        
        
            org.jasig.cas.client
            cas-client-core
            3.3.3
            
                
                    org.slf4j
                    log4j-over-slf4j
                
            
        
    
    
        
            
                org.apache.maven.plugins
                maven-compiler-plugin
                2.3.2
                
                    1.7
                    1.7
                
            
            
                org.apache.tomcat.maven
                tomcat7-maven-plugin
                
                    
                    9003
                    
                    /
                
            
        
    
  • web.xml
  • 
    
    
        Archetype Created Web Application
    
        
        
            org.jasig.cas.client.session.SingleSignOutHttpSessionListener
        
    
        
        
            CAS Single Sign Out Filter
            org.jasig.cas.client.session.SingleSignOutFilter
        
        
            CAS Single Sign Out Filter
            /*
        
    
    
        
        
            CASFilter
            org.jasig.cas.client.authentication.AuthenticationFilter
            
                casServerLoginUrl
                
                
                http://localhost:8080/cas/login
                
            
            
                serverName
                http://localhost:9003
            
        
        
            CASFilter
            /*
        
    
        
        
            CAS Validation Filter
            
                org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter
            
            
                casServerUrlPrefix
                
                http://localhost:8080/cas
            
            
                serverName
                http://localhost:9003
            
        
        
            CAS Validation Filter
            /*
        
    
    
        
        
        
            CAS HttpServletRequest Wrapper Filter
            
                org.jasig.cas.client.util.HttpServletRequestWrapperFilter
            
        
        
            CAS HttpServletRequest Wrapper Filter
            /*
        
    
        
        
            CAS Assertion Thread Local Filter
            org.jasig.cas.client.util.AssertionThreadLocalFilter
        
        
            springSecurityFilterChain
            org.springframework.web.filter.DelegatingFilterProxy
        
        
            CAS Assertion Thread Local Filter
            /*
        
        
            springSecurityFilterChain
            /*
        
    
    
    
  • spring-security.xml
  • 
    
        
        
            
            
            
            
            
            
            
        
    
        
        
            
            
            
            
        
        
            
            
        
        
    
        
        
            
        
        
        
            
            
        
        
        
            
                
                    
                
            
            
            
            
                
                    
                    
                
            
            
        
    
    
        
        
    
        
        
        
        
            
            
            
                
            
            
        
        
    
    
  • UserDetailsServiceImpl
  • public class UserDetailServiceImpl implements UserDetailsService {
        @Override
        public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
            //权限集合
            List list = new ArrayList();
            //添加权限
            list.add(new SimpleGrantedAuthority("ROLE_USER"));
            
            return new User(username, "", list);
        }
    }

你可能感兴趣的:(springsecurity,cas,spring,java)