Configuring Spring Security 5.x
With regard to easy feature or module integration, Spring Boot 2.0 provides an easier way to integrate Spring Security to the application. This recipe will showcase how to apply the new Spring Security 5 to a reactive web application.
Getting started
Open the Spring Boot ch09
project and add the Spring Security 5 module into the existing application.
How to do it...
Let us now start applying security context to the previous reactive application through these steps:
- Open
pom.xml
and add the following starter POM for Spring Security 5:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency>
- Create a new package
org.packt.spring.boot.security
and drop into it the same security context definitionAppSecurityConfig
fromch08
. - Avoid registering
DelegatingFilterProxy
into the container since Spring Boot does it automatically by injectingorg.springframework...