In preparation for reactive and concurrent web programming in the later chapters, Tomcat 9.0 was installed in Chapter 1, Getting Started with Spring to use TLS to enable HTTPS. This recipe will showcase how Spring Security 4.2.2 manages all URL requests to run on secured HTTP protocols only.
Open web project ch04
and create another security model restricting all URL requests to execute on top of the secured HTTP at port 8443
.
After the initial setup and configuration, it is time to experiment with the Spring Security 4.2.2 module:
- Let us now disable the previous
AppSecurityConfig
model by applying comment symbols to its@Configuration
and@EnableWebSecurity
annotations:
//@Configuration //@EnableWebSecurity public class AppSecurityConfig extends WebSecurityConfigurerAdapter { // refer to sources }