Spring Security 5.0.0 M2 Released

Releases | Rob Winch | June 16, 2017 | ...

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

and users.properties



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

Project Site | Reference | Guides | Help

Get the Spring newsletter

Thank you!

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Spring Runtime offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all