Spring Security Java Config Preview: Web Security
Update
Users should refer to the Spring Security Reference which contains more up to date information.
Original Blog Post
In my previous post, I introduced Spring Security Java configuration and discussed some of the logistics of the project. In this post, we will start off by walking through a very simple web security configuration. We will then spice things up a bit with configuration that has been customized some.
Hello Web Security
In this section we go through the most basic configuration for web based security. It can be broken into four steps:
- Updating your dependencies - we demonstrated this using Maven in our previous blog post
- Provide the Spring Security configuration - in our example this is done with a WebSecurityConfigurerAdapter
- Ensure the Spring Security configuration is loaded - in our example this is done with AbstractAnnotationConfigDispatcherServletInitializer
- Configure the springSecurityFilterChain - in our example this is done with AbstractSecurityWebApplicationInitializer …