Mapping sessions to channels and ports
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.
Getting started
Open web project ch04 and create another security model restricting all URL requests to execute on top of the secured HTTP at port 8443.
How to do it...
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
AppSecurityConfigmodel by applying comment symbols to its@Configurationand@EnableWebSecurityannotations:
//@Configuration
//@EnableWebSecurity
public class AppSecurityConfig extends
WebSecurityConfigurerAdapter {
// refer to sources
} Note
The use of the @Order annotation can be another option instead of manually commenting the annotations in AppSecurityConfig...