WebSecurityConfig in spring boot 3.0.+

From Spring Boot 2.7, WebSecurityConfigurerAdapter is deprecated. The WebSecurityConfigurerAdapter class is marked as deprecated in Spring Security 5.4. This is because the class was considered too tightly coupled to the servlet API, making it difficult to support other web technologies such as reactive web applications. Instead, developers are encouraged to use the WebSecurityConfigurer interface, which provides a more flexible and scalable approach to configuring web security. The recommended way to configure security for a web application in Spring Security 6 is to use a Bean that takes an HttpSecurity object as a parameter and returns a SecurityFilterChain object. InMemory basic authentication example: The Bean-based configuration in Spring Security 6 provides a more modern and flexible way to configure security for your application. It replaces the old approach of extending the WebSecurityConfigurerAdapter class, which was used in previous versions of Spring Security....