Spring MVC Security - 23. Login

Тәжірибелік нұсқаулар және стиль

Spring MVC Security - 23. Login
Linkedin: / teddy-smith-015ba61a3
Website: www.teddysmith.io
Github: github.com/teddysmithdev

Пікірлер: 33

  • @TheJuliolocoh
    @TheJuliolocoh Жыл бұрын

    great video

  • @vugiakhanhk17hl23
    @vugiakhanhk17hl232 ай бұрын

    thank you bro ! I was stuck with login 2 day

  • @solomonabu4509
    @solomonabu4509 Жыл бұрын

    antMatchers has been deprecated to requestMatchers. I got some errors because of this

  • @vaiterius

    @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(); }

  • @gabrielcombalia7184
    @gabrielcombalia718410 ай бұрын

    this class 23 doesnt work. a lot of functions deprecated. Help! Congrats from Brasil!

  • @denisonkolling

    @denisonkolling

    9 ай бұрын

    Nenhuma das soluções aqui dos comentários funcionou pra você?

  • @okumujustine
    @okumujustine Жыл бұрын

    Video 22 is missing

  • @TeddySmithDev

    @TeddySmithDev

    Жыл бұрын

    It should be fixed. If it is not please let me know. Thanks for letting me know!

  • @smalhasib1644

    @smalhasib1644

    Жыл бұрын

    @@TeddySmithDev Video 22 is still missing.

  • @vaiterius

    @vaiterius

    Жыл бұрын

    @@smalhasib1644 It's not in the playlist but it's in his channel

  • @lahirusandaruwan63

    @lahirusandaruwan63

    Жыл бұрын

    This is the link for 22th video of playlist --> kzread.info/dash/bejne/mn-WybqIYMS-oLA.html

  • @nguyetanhbuihoang896
    @nguyetanhbuihoang89619 күн бұрын

    i can't login even though it in database, it keep showing invalid username or password, any advice?

  • @ShaimaHamila

    @ShaimaHamila

    16 күн бұрын

    I have the same issue

  • @santhoshraviraj9977
    @santhoshraviraj99774 ай бұрын

    'csrf()' is deprecated and marked for removal. please share the correct code

  • @WalwRafii

    @WalwRafii

    4 ай бұрын

    .csrf(c -> c.disable())

  • @azazel8607

    @azazel8607

    3 ай бұрын

    @@WalwRafii hello! could you show me the full method, I can't figure this csrf out

  • @micham.6078
    @micham.6078 Жыл бұрын

    Video 22 is still missing.

  • @lahirusandaruwan63

    @lahirusandaruwan63

    Жыл бұрын

    This is the link for 22th video of playlist --> kzread.info/dash/bejne/mn-WybqIYMS-oLA.html

  • @johnclarklabasan2110
    @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

    @fragrant3021

    10 ай бұрын

    Same problem, Did you solve it?

  • @fragrant3021

    @fragrant3021

    10 ай бұрын

    When I log in with a registered account, It just redirected to login?error=true

  • @TZ-fd7dk

    @TZ-fd7dk

    6 ай бұрын

    @@fragrant3021 because he is setting user=test and password=test then he can only log in with that one

  • @WalwRafii

    @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
    @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

    @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

    @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

    @the_legend_274

    7 ай бұрын

    do you still have the code?@@user-zz4uj1mr5f

  • @prakosd

    @prakosd

    Ай бұрын

    @@user-zz4uj1mr5f Would you mind share it? I have the same issue.

Келесі