package org.laladev.moneyjinn.server.jwt;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
	@Autowired
	JwtTokenProvider jwtTokenProvider;

	@Bean
	@Override
	public AuthenticationManager authenticationManagerBean() throws Exception {
		return super.authenticationManagerBean();
	}

	@Bean
	public PasswordEncoder getPasswordEncoder() {
		return new BCryptPasswordEncoder();
	}

	@Override
	protected void configure(final HttpSecurity http) throws Exception {
		//@formatter:off
        http
            .httpBasic().disable()
            .csrf().disable()
            .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
            .and()
                .authorizeRequests()
                .antMatchers("/moneyflow/server/user/login").permitAll()
                .antMatchers("/moneyflow/server/user/test").authenticated()
                .antMatchers("/**").permitAll()
                .anyRequest().authenticated()
            .and()
            .apply(new JwtConfigurer(this.jwtTokenProvider));
        //@formatter:on
	}
}
@@ -47,63 +47,29 @@
 ort 
-org.springframework.beans.factory.annotation.Autowired;
+javax.inject.Inject;%0A
 %0Aimp
@@ -310,33 +310,64 @@
 ion.
-web.builders.HttpSecurity
+authentication.configuration.AuthenticationConfiguration
 ;%0Aim
@@ -426,50 +426,29 @@
 web.
-configuration.WebSecurityConfigurerAdapter
+builders.HttpSecurity
 ;%0Aim
@@ -662,102 +662,123 @@
 er;%0A
-%0A@Configuration%0Apublic class SecurityConfig extends WebSecurityConfigurerAdapter %7B%0A%09@Autowired
+import org.springframework.security.web.SecurityFilterChain;%0A%0A@Configuration%0Apublic class SecurityConfig %7B%0A%09@Inject
 %0A%09Jw
@@ -818,27 +818,16 @@
 %0A%09@Bean%0A
-%09@Override%0A
 %09public 
@@ -873,50 +873,135 @@
 ager
-Bean() throws Exception %7B%0A%09%09return super.a
+(final AuthenticationConfiguration authenticationConfiguration)%0A%09%09%09throws Exception %7B%0A%09%09return authenticationConfiguration.getA
 uthe
@@ -1016,20 +1016,16 @@
 nManager
-Bean
 ();%0A%09%7D%0A%0A
@@ -1126,42 +1126,60 @@
 %0A%0A%09@
-Override%0A%09protected void configure
+Bean%0A%09public SecurityFilterChain securityFilterChain
 (fin
@@ -1808,12 +1808,35 @@
 tter:on%0A
+%09%09return http.build();%0A
 %09%7D%0A%7D

stop using deprecated WebSecurityConfigurerAdapter