Using Spring Security for authentication and authorization
This web application has used Spring Security for authentication of users and to authorize them to submit comments. The Maven Spring Security starter needs to be specified, as follows, to enable Spring Security in the web application:
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-webflux</artifactId> <version>5.0.0.M2</version> </dependency> </dependencies>
The following is the Spring Security configuration:
@Configuration @EnableWebFluxSecurity @EnableReactiveMethodSecurity public class SecurityConfig { @Autowired private UserService userService; @Bean public SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity...