I'm trying to make a web application that uses: SpringBoot, Mysql, JDBC , MVC, DAO Thymeleaf, and IntelliJ.
And I'm trying to figure out how Spring security works (which I'm having a lot of difficulty with).
I have previously asked for help in this post:
how to configure spring security for spring boot project
And someone explain to me that I shouldn't use the class WebSecurityConfigurerAdapter because is deprecated but use instead SecurityFilterChain.
@Configuration
public class WebSecurityConfig
{
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception
{
// @formatter:off
http.authorizeRequests()
.mvcMatchers("/userOnly/**").permitAll()
.anyRequest().permitAll();
http.formLogin()
.permitAll()
.loginPage("/loginPage.html");
http.logout()
.permitAll();
// @formatter:on
return http.build();
}
}
It's working perfectly and I thank again Ralan for is help But doing so I can't figure out how to use JDBC and the table that contains my users in my database MySQL for the authentification.
Sorry if my question seems strange but English is not my first language