Latest in branch 5.0
5.0.19
Released 07 Oct 2020
(5 years ago)
SoftwareSpring Security
Branch5.0
Supported
Java/Jakarta EE
Java 8+
Servlet 3.0+
Initial release5.0.0
27 Nov 2017
(8 years ago)
Latest release5.0.19
07 Oct 2020
(5 years ago)
End of
OSS support
31 Mar 2019
(Ended 7 years, 1 month ago)
End of
enterprise support
30 Jun 2020
(Ended 5 years, 10 months ago)
Release noteshttps://github.com/spring-projects/spring-security/releases/tag/5.0.19.RELEASE
Source codehttps://github.com/spring-projects/spring-security/tree/5.0.19.RELEASE
Downloadhttps://github.com/spring-projects/spring-security/releases/tag/5.0.19.RELEASE
Spring Security 5.0 ReleasesView full list

What Is New in Spring Security 5.0

CategoryHighlights
New FeaturesOAuth 2.0 Login; Reactive Support (WebFlux security annotations and testing); Modernized Password Encoding

How does Spring Security 5.0 enable OAuth 2.0 Login?

Spring Security 5.0 introduces first-class OAuth 2.0 Login support out of the box.

In practice this means you can delegate authentication to providers such as Google, GitHub, or Azure AD with minimal configuration. The new client registration model stores provider details in application.yml or application.properties, and the framework automatically creates the authorization request, handles the callback, and populates a populated OAuth2AuthenticationToken.

  • Define client registration under spring.security.oauth2.client.registration.
  • Optionally configure provider details under spring.security.oauth2.client.provider.
  • Secure endpoints with .oauth2Login() in the HttpSecurity DSL.
@Configuration
@EnableWebSecurity
public class SecurityConfig {
    @Bean
    SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
        http
            .authorizeRequests(a -> a
                .anyRequest().authenticated()
            )
            .oauth2Login(); // enables OAuth2 login flow
        return http.build();
    }
}

This matters if your organization is moving to a zero-trust model and wants to avoid custom authentication code.

What reactive capabilities does Spring Security 5.0 add for WebFlux applications?

Spring Security 5.0 adds dedicated annotations and testing support for reactive WebFlux applications.

Key additions:

  • @EnableWebFluxSecurity activates a reactive security filter chain.
  • @EnableReactiveMethodSecurity enables method-level security using reactive return types.
  • WebFlux testing utilities (WebTestClient integration) let you assert security rules without a servlet container.
@Configuration
@EnableWebFluxSecurity
public class ReactiveSecurityConfig {
    @Bean
    SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {
        return http
            .authorizeExchange(ex -> ex
                .pathMatchers("/admin/**").hasRole("ADMIN")
                .anyExchange().authenticated()
            )
            .httpBasic().and()
            .build();
    }
}

Watch out for the shift from HttpSecurity to ServerHttpSecurity - the APIs are similar but not interchangeable.

How has password encoding been modernized in Spring Security 5.0?

Spring Security 5.0 modernizes password encoding by promoting the PasswordEncoder interface and adding BCrypt, SCrypt, and Argon2 implementations as first-class beans.

In production this encourages a move away from legacy MD5PasswordEncoder or plain text storage. The new DelegatingPasswordEncoder lets you migrate existing hashes by prefixing stored passwords with an identifier (e.g., {bcrypt}$2a$10$...).

  • Configure a bean: PasswordEncoder encoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
  • Use encoder.encode(rawPassword) when persisting new credentials.
  • Existing passwords continue to work as long as their prefix matches a registered encoder.

This matters if you need to comply with PCI-DSS or other security standards that require strong hashing algorithms.

Frequently Asked Questions

Can I use Spring Security 5.0 OAuth2 login with multiple providers simultaneously?
Yes, you declare multiple client registrations under spring.security.oauth2.client.registration and the framework will handle each provider independently.

Do I need to replace my existing WebMvc security configuration when moving to WebFlux?
You keep the MVC configuration separate; WebFlux uses @EnableWebFluxSecurity and ServerHttpSecurity while MVC continues to use @EnableWebSecurity and HttpSecurity.

Is Argon2 password encoding available out of the box in Spring Security 5.0?
Yes, Argon2PasswordEncoder is provided as a bean and can be referenced through the DelegatingPasswordEncoder.

How do I test a reactive security rule without starting a full server?
Use WebTestClient together with the @WebFluxTest slice and configure the SecurityWebFilterChain bean.

What code change is required to migrate from a legacy PasswordEncoder to the new DelegatingPasswordEncoder?
Replace the old encoder bean with PasswordEncoderFactories.createDelegatingPasswordEncoder() and prefix stored passwords with the appropriate {id}.

Will existing BCrypt hashes continue to work after upgrading to Spring Security 5.0?
Yes, BCrypt hashes are recognized automatically by DelegatingPasswordEncoder.

Releases In Branch 5.0

VersionRelease date
5.0.1907 Oct 2020
(5 years ago)
5.0.1805 Aug 2020
(5 years ago)
5.0.1703 Jun 2020
(5 years ago)
5.0.1606 May 2020
(6 years ago)
5.0.1501 Apr 2020
(6 years ago)
5.0.1405 Feb 2020
(6 years ago)
5.0.1305 Aug 2019
(6 years ago)
5.0.1202 Apr 2019
(7 years ago)
5.0.1110 Jan 2019
(7 years ago)
5.0.1028 Nov 2018
(7 years ago)
5.0.915 Oct 2018
(7 years ago)
5.0.810 Sep 2018
(7 years ago)
5.0.726 Jul 2018
(7 years ago)
5.0.612 Jun 2018
(7 years ago)
5.0.508 May 2018
(8 years ago)
5.0.404 Apr 2018
(8 years ago)
5.0.328 Feb 2018
(8 years ago)
5.0.219 Feb 2018
(8 years ago)
5.0.124 Jan 2018
(8 years ago)
5.0.027 Nov 2017
(8 years ago)
5.0.0.RC130 Oct 2017
(8 years ago)
5.0.0.M509 Oct 2017
(8 years ago)
5.0.0.M413 Sep 2017
(8 years ago)
5.0.0.M324 Jul 2017
(8 years ago)
5.0.0.M215 Jun 2017
(8 years ago)
5.0.0.M110 May 2017
(9 years ago)