News and Events

Spring Security 5.0.0 M2 Released

On behalf of the community, I’m pleased to announce the release of Spring Security 5.0.0 M2. This release includes bug fixes, new features, and is based off of Spring Framework 5.0.0 RC2.

A complete example of using Spring Security to secure a Spring WebFlux application can be found in the Spring Security samples at hellowebflux and hellowebfluxfn.

The highlights of the release include:

Simplified Reactive Security Configuration

It is now very easy to setup a minimal Reactive Security Configuration. Add @EnableWebFluxSecurity and provide a UserDetailsRepository

public class SecurityConfig {
    public UserDetailsRepository userDetailsRepository() {
        return new MapUserDetailsRepository(User.withUsername("user")

We have added UserDetailsManagerResourceFactoryBean which provides a simple way to create a UserDetailsRepository using a properties file. For example:

public UserDetailsRepositoryResourceFactoryBean userDetailsService() {
    return UserDetailsRepositoryResourceFactoryBean


For non reactive applications, there is a new UserDetailsManagerResourceFactoryBean to create an InMemoryUserDetailsManager from a properties file

WebTestClient Support

This release also adds support for WebTestClient. For example, you can run as a test user using the following:

ExchangeMutatorWebFilter exchangeMutator = new ExchangeMutatorWebFilter();
WebTestClient mockRest = WebTestClient.bindToApplicationContext(this.context)
    .webFilter(exchangeMutator) // add the exchangeMutator

        // run only this request with a mocked user
comments powered by Disqus