July 2018
Intermediate to advanced
268 pages
7h 36m
English
In the Spring Security configuration, we tweak the springSecurityFilterChain bean, as shown in the following code snippet:
@Beanpublic SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http){ AuthenticationWebFilter authenticationJWT = new AuthenticationWebFilter(new UserDetailsRepositoryReactiveAuthenticationManager(userDetailsRepository())); authenticationJWT.setAuthenticationSuccessHandler(new JWTAuthSuccessHandler()); http.csrf().disable(); http .authorizeExchange() .pathMatchers(WHITELISTED_AUTH_URLS) .permitAll() .and() .addFilterAt(authenticationJWT, SecurityWebFiltersOrder.FIRST) .authorizeExchange() .pathMatchers(HttpMethod.GET, "/api/movie/**").hasRole("USER") .pathMatchers(HttpMethod.POST, ...Read now
Unlock full access