Two Factor Authentication & JWT | Spring boot + Angular | Full application

Поделиться
HTML-код
  • Опубликовано: 22 ноя 2024

Комментарии • 129

  • @BoualiAli
    @BoualiAli  Год назад

    Join the Micro Services course waiting list and get and get an exclusive EARLY-BIRD discount
    aliboucoding.ck.page/d0f9317e13

  • @sanjmgr05
    @sanjmgr05 8 месяцев назад +2

    Thank you for implementing 2FA. When verifying TOTP, if the email and code match, it generates an access token without requiring the password. It utilizes the User object to generate the Authentication Object. This means that with just the endpoint, email, and code (excluding the password), an accessToken can be generated, which may not be the intended behavior.

  • @restonspositifs3336
    @restonspositifs3336 8 месяцев назад

    I like this man. He is good and speak very well in English and in French. Proud to discover your RUclips channel

    • @BoualiAli
      @BoualiAli  7 месяцев назад

      Glad you liked it!

  • @aniketkadam9830
    @aniketkadam9830 Месяц назад

    Could you please make a detailed video on how to solve cross-origin issues? It would be great to cover the cause of these issues, how CORS works, and practical solutions like configuring headers in the backend. Thanks!

  • @gabrielfono844
    @gabrielfono844 9 месяцев назад

    As software engineer here is seattle waghinston after teaching myself coding for two years , I can tell you are doing an amazing job.
    I will just purchase your course to update my skills.
    Thanks a lot

    • @BoualiAli
      @BoualiAli  7 месяцев назад

      Glad you liked it!

  • @bhaskardixit1564
    @bhaskardixit1564 4 месяца назад

    Thank you for serving community. I have found this channel upto the mark with good explaination.

  • @nam9338
    @nam9338 3 месяца назад

    This is a good tutorial. Thank you and I wish you more success.

  • @charlesfouquet
    @charlesfouquet Год назад

    Man, with this video series of yours (especially Spring Security & JWT, JWT Logout and this one), you litteraly saved my end of retraining course exam! I'm changing careers from Sound Engineer to Software Engineer, and you did such a good job explaining abstract concepts that I now see clearer and feel more confident talking about my app's security during the exam! Thank you a lot again, and I'll stick around for the next videos 😉
    Take care 😃

    • @BoualiAli
      @BoualiAli  Год назад

      I'm really happy to know that.
      Wish you all the best

  • @dilipkumarbk7657
    @dilipkumarbk7657 Год назад

    A 1000000% request for the cors related video, it's most required and it'll definitely be a great video. Respect from India sir. Thanks for this video. 😊😊

    • @BoualiAli
      @BoualiAli  Год назад

      Happy you liked it!
      Sure, soon

  • @amirkenesbay1615
    @amirkenesbay1615 Год назад +2

    First. Thank u for an amazing tutorial

  • @yousfimarwen5506
    @yousfimarwen5506 Год назад

    in angular When you use providedIn: 'root' in the service's metadata, you don't need to explicitly add the service to the providers array of the AppModule :)

    • @BoualiAli
      @BoualiAli  Год назад

      The HttpClient services is not provided in root
      I already explained that in the angular course.
      Go and check it 😉

  • @a.m.jyotiprakashsahu5754
    @a.m.jyotiprakashsahu5754 Год назад +1

    sir, please make a video on Spring Security With Okta.

    • @BoualiAli
      @BoualiAli  Год назад

      Check the keycloak video

  • @alextech4881
    @alextech4881 Год назад

    Solid video! Thank you so much for the free content, it's much appreciated!

  • @sovannborithyun5205
    @sovannborithyun5205 Год назад +1

    Amazing idea as always.
    Would be best to add refresh token and logout with Angular project.

    • @BoualiAli
      @BoualiAli  Год назад

      Great suggestion!

    • @sovannborithyun5205
      @sovannborithyun5205 Год назад

      @@BoualiAliany plan to have this video, waiting this to complete the whole authentication and authorization 😊

  • @phamust
    @phamust Год назад

    Solid content and straight forward as usual.
    Thank you Alibou!

  • @iuliusciorica282
    @iuliusciorica282 Год назад

    Exactly what I was looking for, thank you!

  • @raxkhmanLite
    @raxkhmanLite Год назад

    Quality material✨ Thank you for your hard work!🙇‍♀

    • @BoualiAli
      @BoualiAli  Год назад +1

      Thank you too!
      Happy you liked it!

  • @amineamine58
    @amineamine58 Год назад +1

    Amazing video as always ✨✨✨✨ This was very informative and comprehensive.
    Could you please do a video of social media authentication with Spring boot and a front end framework like Angular. I think that would be awesome !!

  • @QuanTran-ej3jh
    @QuanTran-ej3jh Год назад

    Thank you very much! Can you please make videos on how to deploy a Spring Boot application, Angular, with database like MySQL,... on AWS, or Azure? I would be really really really appreciate it! Thank you very much!

    • @BoualiAli
      @BoualiAli  Год назад

      I’m already working on it
      It will be released soon

  • @nesier07
    @nesier07 Год назад +1

    Hello, I would like to point out that in the frontend we didn't specify a role nor did we set it to user by default. I may be wrong though. Anyways, another amazing video in an amazing playlist that literally saved my life.

    • @BoualiAli
      @BoualiAli  Год назад

      That's true, I just didn't want to spend time on that since it is so simple to setup

  • @merxxibeaucoup9093
    @merxxibeaucoup9093 Год назад +1

    Thank you for your hard work and kindness , Ali
    i kinda do have a question ::::: the verificationRequest takes in two inputs (email and code) but i see you passed only the code when asked to verify

    • @BoualiAli
      @BoualiAli  Год назад

      Let me check

    • @merxxibeaucoup9093
      @merxxibeaucoup9093 Год назад

      @@BoualiAli i only asked because I used React for my frontend .. I figured out a way around it , thanks 🙏🏾

  • @nasraouislah6118
    @nasraouislah6118 Год назад

    As always u are the best bro 🙏🙌

    • @BoualiAli
      @BoualiAli  Год назад +1

      You are the best ❤️

  • @tambiaegbebot2091
    @tambiaegbebot2091 9 месяцев назад

    This is great content. Thank you

  • @user-cb6st9fq6p
    @user-cb6st9fq6p Год назад

    Good Job Ali as usually 👍👌

  • @ChristianDev93
    @ChristianDev93 11 месяцев назад +1

    Hello, good video.
    Question, what theme do you use in intellij?

    • @BoualiAli
      @BoualiAli  7 месяцев назад

      the default theme

  • @firas_hkimi
    @firas_hkimi Год назад

    Lovely tutorial Sir.👏👏

  • @siwarbouali-fv6co
    @siwarbouali-fv6co 8 месяцев назад

    ce playlist c'est une authentification single Sign-on ou non ?

  • @Noname-sn6ty
    @Noname-sn6ty Год назад

    Hello Mr Ali nice content as always please include the part of oauth2 along with this code of jwt, it’s a sincere request will be waiting for that
    Thanks

    • @BoualiAli
      @BoualiAli  Год назад +1

      I prepared it, I just need to record it 😅
      I’m Trying to manage my time for recording videos as max as possible

    • @Noname-sn6ty
      @Noname-sn6ty Год назад

      Wonderful you're the best sir

  • @mariosavala5128
    @mariosavala5128 Год назад

    Your videos are very good, with what application do you record the cell phone and project it to the computer, could you log in with an LDAP?

    • @BoualiAli
      @BoualiAli  Год назад

      It is the default app in the iPhone

  • @ganeshbabu8263
    @ganeshbabu8263 Год назад

    Can you make a video about changing the password for the current login user and forget password functionally 🙏

  • @superboy7905
    @superboy7905 Год назад

    Amazing video, Thanks

  • @alpersener4269
    @alpersener4269 Год назад

    thank you king 👑

  • @errahulrajocjp
    @errahulrajocjp 10 месяцев назад

    This is KGF, #Gold_Mines for #Spring Security JWT with Spring Boot !!

    • @BoualiAli
      @BoualiAli  7 месяцев назад

      Glad you liked it!

  • @martianstarslit3768
    @martianstarslit3768 9 месяцев назад

    Where can I get or code of spring security where both users are not admin. Eg, you are creating a Doctor and Patient app. Each person login depending on their roles. No admin creates any of them

  • @HYR0720
    @HYR0720 Год назад

    I would like to know How can we test Service method in the UnitTest.

  • @Sebastian-zs8cp
    @Sebastian-zs8cp 10 месяцев назад

    hi how do you develop roles permission on paper(link) and why hard coded not in db?

  • @misterabdel8522
    @misterabdel8522 Год назад

    Thanks, good video .

  • @ramiammous9955
    @ramiammous9955 Год назад

    bonsoir si ali, vous ferez plus des cours en français?

    • @BoualiAli
      @BoualiAli  Год назад

      non :(
      Sur Udemy parfois je fais des cours en francais

    • @ramiammous9955
      @ramiammous9955 Год назад

      @@BoualiAli merci :)

  • @dmode1535
    @dmode1535 Год назад

    Great, thank you.

  • @karthikb-y1t
    @karthikb-y1t 10 месяцев назад

    I have a doubt. Like if an attacker some how hacks gmail and password of any user. Then attacker can also scan the QR code through his\her authenticator app like normal user right?

    • @BoualiAli
      @BoualiAli  10 месяцев назад +1

      If you‘re email is hacked, do you still care about one application among all the lost data, passwords, bank cards…

  • @alonsotorres4698
    @alonsotorres4698 7 месяцев назад

    the best

  • @luckytheracer4557
    @luckytheracer4557 Год назад

    Implement oauth with angular plus spring boot sir

  • @quannguyenviet398
    @quannguyenviet398 Год назад

    waiting for logout and refresh token ,i stuck in it for like 2or 3days,
    when logout i dont have to update the status of expired and revoke, i just remove it in user local storage but not in the database, hope you making another video to address all my confusion

    • @BoualiAli
      @BoualiAli  Год назад

      Already implemented. Check the playlist

    • @quannguyenviet398
      @quannguyenviet398 Год назад

      @@BoualiAli i means to handle to refresh-token request in front-end

  • @sulabhbrt
    @sulabhbrt Год назад

    can you please do same thing in react

  • @carlosandresmahechalozada8564
    @carlosandresmahechalozada8564 Год назад

    a lot of thanks :)

  • @logic_master950
    @logic_master950 Год назад +1

    @Bouali. Please help us with password reset tutorial 😭😭

    • @BoualiAli
      @BoualiAli  Год назад +1

      I will do that for sure

    • @logic_master950
      @logic_master950 Год назад +1

      @@BoualiAli with jwt and using mail API please

  • @abderrahmenhelaoui6511
    @abderrahmenhelaoui6511 Год назад

    comment modifier le code pour obliger l'utilisateur a toujours utilise l'authentification à 2 facteurs

  • @ramym.moustafa2507
    @ramym.moustafa2507 Год назад +1

    The Library Not Secure : Cx8fd408ac-dd80 8.1 Inclusion of Functionality from Untrusted Control Sphere vulnerability pending CVSS allocation

  • @alphateam4308
    @alphateam4308 Год назад

    i have a problem the token stored in local in angular is not the same token given by the spring boot, so I can't execute methode neither for admin or user

    • @alphateam4308
      @alphateam4308 Год назад

      can you please make a video how to consume the methods from spring in angular with the authorities and all that

    • @BoualiAli
      @BoualiAli  Год назад

      Already done. Check the angular vide

    • @alphateam4308
      @alphateam4308 Год назад

      @@BoualiAli thank you

    • @alphateam4308
      @alphateam4308 Год назад

      @@BoualiAli I have another problem when I register with 2fa I can't execute admin methods, I guess the problem is here:
      if (request.isMfaEnabled()){
      user.setSecret(tfaService.generateNewSecret());
      }
      var savedUser =repository.save(user);
      var jwtToken= jwtService.generateToken(user);
      var refreshToken = jwtService.generateRefreshToken(user);
      saveUserToken(savedUser, jwtToken);
      return AuthenticationResponse.builder()
      .secretImageUri(tfaService.generateQrCodeImageUri(user.getSecret()))
      .accessToken("") // here
      .refreshToken("") //here
      .mfaEnabled(user.isMfaEnabled())
      .build();

    • @alphateam4308
      @alphateam4308 Год назад

      i cant update it needs admin role: it works on springboot but it doesn't work on angular
      com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `org.springframework.security.core.GrantedAuthority` (no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
      at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 403] (through reference chain: com.example.project_test.Entities.Etudiant["authorities"]->java.util.ArrayList[11])

  • @EduardoSGouveia
    @EduardoSGouveia Год назад

    Always BadCredentialsException in register after scan QR Code and insert code!

    • @BoualiAli
      @BoualiAli  Год назад

      Start a debug session and you will find out.

    • @EduardoSGouveia
      @EduardoSGouveia Год назад

      I got it. the problem with a data time my computer (server tomcat).

    • @shreyanssethia7368
      @shreyanssethia7368 Год назад

      Getting the same error... How did you solve it?

    • @EduardoSGouveia
      @EduardoSGouveia Год назад

      Check your o'clock in server, or date time in cellphone@@shreyanssethia7368

    • @rahathasan5971
      @rahathasan5971 7 месяцев назад

      My code and secret is always giving false but everything is correcr is it the problem u mention how to correct it

  • @rahathasan5971
    @rahathasan5971 7 месяцев назад

    Sir my qr image is not showing

    • @BoualiAli
      @BoualiAli  7 месяцев назад

      post your error

  • @depression_plusplus6120
    @depression_plusplus6120 Год назад

    Is this stateless?

  • @emmanuelsahrsewah
    @emmanuelsahrsewah Год назад

    🙌🙌🙌🙌🙌

  • @gabrielfono844
    @gabrielfono844 9 месяцев назад

    I am building an free application to help senior high school or anyone thinking about returning to school to choose a major based on real-life experiences shared by others, in addition to their degree.
    people will share experience about their degree and professional career to help others make informal decision.
    I am not sure if people will want to download the app for two factor authentification.
    I think will probably prefer email to send to their email address that they could be verify that way
    What can I go about implement it sir ?

    • @medAmineRg
      @medAmineRg 8 месяцев назад

      hey, i guess the sms way is more friendly

  • @pjoter93
    @pjoter93 Год назад

    This approach has one fundamental logical error. This is one factor authentication because someone who has access to the phone with Auth App can get token via request "/verify" completely omitting "/authenticate" for example through the Postman application (password is not checked in "/verify"). You should add field "code" to AuthenticationRequest class and if user don't provide it (it's null) and have enabled 2FA then return information that he needs to provide code, if he send another request with correct user, password and code then we return access token.
    Apart from that, the concept was nicely presented and it was good to watch. Good luck

    • @BoualiAli
      @BoualiAli  Год назад

      Would you give your phone to anyone?
      Would leave without a passcode?

    • @pjoter93
      @pjoter93 Год назад

      ​@@BoualiAli This isn't about that. It's just not 2FA if you can authenticate and get token with just the code from your phone and no password. Other than that, it's a really nice guide. Don't take it personal :)

    • @lightyear3429
      @lightyear3429 10 месяцев назад

      @@BoualiAli He is right. I checked this video because I made the similar mistake in my app and wanted to see how people solve it with JWT. The answer is you need two JWTs - one for a state "logged in with password, has not logged in with QR", and another for a state "logged in with QR". '/verify' endpoint needs only to be accessible by those with at least the former state

    • @lightyear3429
      @lightyear3429 10 месяцев назад

      @@pjoter93 I'm curious as to what solution you think would fit this problem?

    • @pjoter93
      @pjoter93 10 месяцев назад

      ​@@lightyear3429 in my first comment I described how I did it in my case :) and it's working great. In my app you can't turn on 2FA on register, but after login in settings like in facebook.

  • @JaiKumar-jh7hl
    @JaiKumar-jh7hl 7 месяцев назад

    Worst video I ever seen

    • @BoualiAli
      @BoualiAli  7 месяцев назад

      Here is the solution:
      1- Unsubscribe
      2- Go learn from somewhere else, you are not welcome here