Installing Spring Security On Spring MVC Project

These are steps required to install Spring Security for a form authentication implementation on a Spring MVC project.

  1. Maven Dependencies.

    
            org.springframework.security
            spring-security-core
            3.1.4.RELEASE
    
    
            org.springframework.security
            spring-security-config
            3.1.4.RELEASE
    
    
            org.springframework.security
            spring-security-web
            3.1.4.RELEASE
    
    
  2. Add Spring Security filter to web.xml
    
    
            springSecurityFilterChain
            org.springframework.web.filter.DelegatingFilterProxy
    
    
    
            springSecurityFilterChain
            /*
    
    
  3. Add a security-context.xml spring beans config file. You can place all your security config on root application context xml but separating it would produce clearer code without namespace prefix clutter
    
    
    
    
    
    
    
    
  4. Add basic HTTP form authentication and provider as seen on Spring reference manual