How to move username/passwords out of spring-security-context.xml?

前端 未结 6 1430
一个人的身影
一个人的身影 2020-12-16 23:01

I am using Spring Security in one of my project. The web-app requires the user to login. Hence I have added few usernames and passwords in the spring-security-context.xml fi

6条回答
  •  半阙折子戏
    2020-12-16 23:27

    This works for me for Spring security authentication and authorization using Properties file:

    
    
        
    
        
            
            
            
                
                    classpath:abc.properties
                
            
        
    
        
    
        
            
            
    
             
        
        
        
    
        
            
                 
            
            
            
         
    
    

    The abc.properties file:

    stat.user=xyz
    stat.pwd=xyz
    

    The web.xml entry for spring-security implementation:

    
        springSecurityFilterChain
        org.springframework.web.filter.DelegatingFilterProxy
        
    
    
    
        springSecurityFilterChain
        /*
    
    

提交回复
热议问题