antMatchers has been deprecated to requestMatchers. I got some errors because of this
@vaiterius
Жыл бұрын
For those of you using Spring Boot 3, I used this filterchain: @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{ http.csrf().disable() .authorizeHttpRequests() .requestMatchers("/login", "/register", "/clubs", "/register/**", "/css/**", "/js/**") .permitAll() .and() .formLogin(form -> form .loginPage("/login") .defaultSuccessUrl("/clubs") .loginProcessingUrl("/login") .failureUrl("/login?error=true") .permitAll() ).logout( logout -> logout .logoutRequestMatcher(new AntPathRequestMatcher("/logout")).permitAll() ); return http.build(); }
@gabrielcombalia718410 ай бұрын
this class 23 doesnt work. a lot of functions deprecated. Help! Congrats from Brasil!
@denisonkolling
9 ай бұрын
Nenhuma das soluções aqui dos comentários funcionou pra você?
@okumujustine Жыл бұрын
Video 22 is missing
@TeddySmithDev
Жыл бұрын
It should be fixed. If it is not please let me know. Thanks for letting me know!
@smalhasib1644
Жыл бұрын
@@TeddySmithDev Video 22 is still missing.
@vaiterius
Жыл бұрын
@@smalhasib1644 It's not in the playlist but it's in his channel
@lahirusandaruwan63
Жыл бұрын
This is the link for 22th video of playlist --> kzread.info/dash/bejne/mn-WybqIYMS-oLA.html
@nguyetanhbuihoang89619 күн бұрын
i can't login even though it in database, it keep showing invalid username or password, any advice?
@ShaimaHamila
16 күн бұрын
I have the same issue
@santhoshraviraj99774 ай бұрын
'csrf()' is deprecated and marked for removal. please share the correct code
@WalwRafii
4 ай бұрын
.csrf(c -> c.disable())
@azazel8607
3 ай бұрын
@@WalwRafii hello! could you show me the full method, I can't figure this csrf out
@micham.6078 Жыл бұрын
Video 22 is still missing.
@lahirusandaruwan63
Жыл бұрын
This is the link for 22th video of playlist --> kzread.info/dash/bejne/mn-WybqIYMS-oLA.html
@johnclarklabasan2110 Жыл бұрын
spring.security.user.name=test spring.security.user.password=test this worked when I log in but when I used the account I register it is returning an error. can someone help me?
@fragrant3021
10 ай бұрын
Same problem, Did you solve it?
@fragrant3021
10 ай бұрын
When I log in with a registered account, It just redirected to login?error=true
@TZ-fd7dk
6 ай бұрын
@@fragrant3021 because he is setting user=test and password=test then he can only log in with that one
@WalwRafii
4 ай бұрын
Logging in with an account you registered yourself is not supposed to work because we haven't implemented that yet. It is done it the next video.
@kelvinwarui2982 Жыл бұрын
Even with this code the default login page is still showing am almost giving up help @Configuration @EnableWebSecurity public class SecurityConfiguration { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http.csrf().disable() .authorizeHttpRequests() .requestMatchers("/login", "/register","/css/**") .permitAll() .and() .formLogin(form -> form .loginPage("/login") .defaultSuccessUrl("/home") .loginProcessingUrl("/login") .failureUrl("/login?error=true") .permitAll() ).logout( logout -> logout .logoutRequestMatcher(new AntPathRequestMatcher("/logout")).permitAll() ); return http.build(); }
@user-zz4uj1mr5f
Жыл бұрын
KZread automatically deletes my answer considering the text a violation of the rules. In general, in spring 6, the syntax for writing code was changed. I tried to post a working code, but KZread erases it.
@nicolewijaya7252
9 ай бұрын
@@user-zz4uj1mr5f perhaps can you post it in stackoverflow? I saw that we need to put inside the authorizeHttpRequests but there are no replacement for .and() so can I just erase it?
@the_legend_274
7 ай бұрын
do you still have the code?@@user-zz4uj1mr5f
@prakosd
Ай бұрын
@@user-zz4uj1mr5f Would you mind share it? I have the same issue.
Пікірлер: 33
great video
thank you bro ! I was stuck with login 2 day
antMatchers has been deprecated to requestMatchers. I got some errors because of this
@vaiterius
Жыл бұрын
For those of you using Spring Boot 3, I used this filterchain: @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{ http.csrf().disable() .authorizeHttpRequests() .requestMatchers("/login", "/register", "/clubs", "/register/**", "/css/**", "/js/**") .permitAll() .and() .formLogin(form -> form .loginPage("/login") .defaultSuccessUrl("/clubs") .loginProcessingUrl("/login") .failureUrl("/login?error=true") .permitAll() ).logout( logout -> logout .logoutRequestMatcher(new AntPathRequestMatcher("/logout")).permitAll() ); return http.build(); }
this class 23 doesnt work. a lot of functions deprecated. Help! Congrats from Brasil!
@denisonkolling
9 ай бұрын
Nenhuma das soluções aqui dos comentários funcionou pra você?
Video 22 is missing
@TeddySmithDev
Жыл бұрын
It should be fixed. If it is not please let me know. Thanks for letting me know!
@smalhasib1644
Жыл бұрын
@@TeddySmithDev Video 22 is still missing.
@vaiterius
Жыл бұрын
@@smalhasib1644 It's not in the playlist but it's in his channel
@lahirusandaruwan63
Жыл бұрын
This is the link for 22th video of playlist --> kzread.info/dash/bejne/mn-WybqIYMS-oLA.html
i can't login even though it in database, it keep showing invalid username or password, any advice?
@ShaimaHamila
16 күн бұрын
I have the same issue
'csrf()' is deprecated and marked for removal. please share the correct code
@WalwRafii
4 ай бұрын
.csrf(c -> c.disable())
@azazel8607
3 ай бұрын
@@WalwRafii hello! could you show me the full method, I can't figure this csrf out
Video 22 is still missing.
@lahirusandaruwan63
Жыл бұрын
This is the link for 22th video of playlist --> kzread.info/dash/bejne/mn-WybqIYMS-oLA.html
spring.security.user.name=test spring.security.user.password=test this worked when I log in but when I used the account I register it is returning an error. can someone help me?
@fragrant3021
10 ай бұрын
Same problem, Did you solve it?
@fragrant3021
10 ай бұрын
When I log in with a registered account, It just redirected to login?error=true
@TZ-fd7dk
6 ай бұрын
@@fragrant3021 because he is setting user=test and password=test then he can only log in with that one
@WalwRafii
4 ай бұрын
Logging in with an account you registered yourself is not supposed to work because we haven't implemented that yet. It is done it the next video.
Even with this code the default login page is still showing am almost giving up help @Configuration @EnableWebSecurity public class SecurityConfiguration { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http.csrf().disable() .authorizeHttpRequests() .requestMatchers("/login", "/register","/css/**") .permitAll() .and() .formLogin(form -> form .loginPage("/login") .defaultSuccessUrl("/home") .loginProcessingUrl("/login") .failureUrl("/login?error=true") .permitAll() ).logout( logout -> logout .logoutRequestMatcher(new AntPathRequestMatcher("/logout")).permitAll() ); return http.build(); }
@user-zz4uj1mr5f
Жыл бұрын
KZread automatically deletes my answer considering the text a violation of the rules. In general, in spring 6, the syntax for writing code was changed. I tried to post a working code, but KZread erases it.
@nicolewijaya7252
9 ай бұрын
@@user-zz4uj1mr5f perhaps can you post it in stackoverflow? I saw that we need to put inside the authorizeHttpRequests but there are no replacement for .and() so can I just erase it?
@the_legend_274
7 ай бұрын
do you still have the code?@@user-zz4uj1mr5f
@prakosd
Ай бұрын
@@user-zz4uj1mr5f Would you mind share it? I have the same issue.