Spring-Boot User Management System Using Spring-Security & Angular | Login, JWT, Auth

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

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

  • @durgamaharjan-e5i
    @durgamaharjan-e5i 22 дня назад +1

    Big Thank You for the content. It was really a good experience on learning the concept. Please keep on making the content like this.

    • @PhegonDev
      @PhegonDev  22 дня назад

      @@durgamaharjan-e5i thanks for the encouragement 🙏

  • @U2_yT17
    @U2_yT17 5 месяцев назад +2

    only guy with working code for this JWT, awesome man

    • @PhegonDev
      @PhegonDev  5 месяцев назад

      Thanks 🙏🏽🙏🏽 I'm happy it was helpful

  • @TheFlacee
    @TheFlacee 4 месяца назад +2

    Really good tutorial and thanks for the code.
    When it comes to the user role, if we save it in the "sessionStorage". Can the user can modify it from "USER" to "ADMIN" in their browser ? How can we solve this security issue?

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

      Alternatively, You can encrypt the token or role before saving in the localstorage. It's best to use http secure cookies or web cryptography api to secure token from xss atacks. I'll be using those in my next tuts, local storage is more straightforwad and beginer friendly that's why i use them for tutorials. I think i should be doing some tech talks about these rather than tutorial per say

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

      @@PhegonDev Great! I will keep watching! Thank you 👍🏼👍🏼

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

    So, in 1:48:00 you start talking about a token. Is a token needed to register a user? If needed, how can anyone who wants to create an account create an account if he has no account to login to get a token?

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

      Yeah. It's more like an enterprice where an admin manages staff. He can register a staff e.t.c. It's a tutorial to show spring security and jwt functionality. You can modify at your end e.g ecommerce system where everybody can register and manage their own account

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

    In ouruser class that implementes userdetails in that class why you didn't override get password method

  • @Gabyy_Intenta
    @Gabyy_Intenta 9 месяцев назад +1

    Thank you very much!! It is just what I was looking for 😎

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

      ✌🏾✌🏾

  • @pranavmohol9699
    @pranavmohol9699 3 месяца назад +1

    In entity there is something wrong happened idk its getting emali or password

  • @grow9400
    @grow9400 5 месяцев назад +1

    Superb !!! I'm getting a simple error in extends GrantedAuthority, it says "Could not write JSON: A granted authority textual representation is required"

    • @PhegonDev
      @PhegonDev  5 месяцев назад

      You can share the full class code let me see your imports, code and what you are doing. That will give a hint on why the error is so

    • @mymememy-co3uy
      @mymememy-co3uy 3 месяца назад

      I got this error too. Could you help me,plz.

  • @السفرةالكرامالبررة
    @السفرةالكرامالبررة 9 месяцев назад +1

    Hello thanks a lot for this tuto , i ve a qst plz am trying to do this project now so from where did u get that long string value "secreteString" ?

    • @PhegonDev
      @PhegonDev  9 месяцев назад +1

      secreteString is just a dummy data. You can replace it with any dummy value of yours. it's going to use the algorithm to create an validate a JWT token

    • @السفرةالكرامالبررة
      @السفرةالكرامالبررة 9 месяцев назад

      @@PhegonDev thanks a lot , looking for other tutos to learn from u as well :)

  • @r.a.139
    @r.a.139 22 дня назад

    Hello, one question. Why is the Logout button not shown until the site is refreshed?

    • @PhegonDev
      @PhegonDev  22 дня назад

      @r.a.139 the state changed is not detected by the navbar component. After login find a way to trigger a state change

    • @r.a.139
      @r.a.139 22 дня назад

      @@PhegonDev Appreciate the tutorial and the quick answer!

  • @ArmandoCaceres-qq6tg
    @ArmandoCaceres-qq6tg 23 дня назад +1

    Eres el mejor

    • @PhegonDev
      @PhegonDev  23 дня назад

      @@ArmandoCaceres-qq6tg Gracias amigo

  • @luctandoum8541
    @luctandoum8541 9 месяцев назад +1

    sir i just finish spring security but i noticed:
    user with role ADMIN can login well but what ever orther role don't work
    having bad credentials

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

      hi,
      Create
      public enum Role {
      USER,
      ADMIN
      }
      and go SecurityConfig Class
      @Bean
      public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws Exception{
      httpSecurity.csrf(AbstractHttpConfigurer::disable)
      .cors(Customizer.withDefaults())
      .authorizeHttpRequests(request-> request.requestMatchers("/auth/**", "/public/**").permitAll()
      .requestMatchers("/user/**").hasAnyAuthority((Role.USER).name())
      .requestMatchers("/adminuser/**").hasAnyAuthority((Role.ADMIN).name(),(Role.USER).name())

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

      .requestMatchers("/admin/**").hasAnyAuthority((Role.ADMIN).name())

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

      It would be safer this way

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

      @@mucizelerden i finally did well. all are fine now

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

    I have downloaded the code but its not working, i am not getting it

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

      If you follow the tutorial step by step, you shouldn’t have any issues. However, if you clone the project from GitHub and try to run it directly, you might encounter some errors. This is because the project is configured for my environment, and you'll need to adjust a few things to match yours. For example, you’ll need to replace the database credentials with your own and ensure the Java version matches what’s installed on your machine. Make sure to build the project properly before running it. The code is meant as a guide in case you run into issues during implementation on your side.

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

      @@PhegonDev 31:44 there is one method which was deprecated - "parser()". I dont truly understand what I need to do with all results of this deprecation, how should i use all this code u write after?

  • @diegoalejandrocarrillomore2156
    @diegoalejandrocarrillomore2156 4 месяца назад +1

    Muy bueno el video

  • @pranavmohol9699
    @pranavmohol9699 3 месяца назад +1

    Anyone can help me plzz

  • @luctandoum8541
    @luctandoum8541 9 месяцев назад +1

    hello sir, you did good job.
    but this tutorial would be the best if:
    -create manualy role. assuming that
    -admin can easily create new user and affect one or multiple Roles,
    -admin can easily update user in order to reduce or assign new existing role
    -admin can access users endpoint.

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

      Yeah, Thanks, that's true. Just wanted to show how the concept works in general.

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

      @@PhegonDev okay sir. Do you mind create with all process as i try to elaborate?
      It will be so helpfull to me. And i am pretty sur many will like it
      of course with same stack(spring boot and Angular)
      thank in advance

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

      @@luctandoum8541 I will drop some more advance projects with those implementations. But To recreate this. it woun't be a good idea

  • @markjosephgarcia3342
    @markjosephgarcia3342 3 месяца назад +1

    can you provide change password

  • @AttackDevice-h7q
    @AttackDevice-h7q 4 месяца назад +1

  • @MdAamir-sl8lu
    @MdAamir-sl8lu 4 месяца назад +1

    Plz make a complete project like ecommerce project

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

      Yeah, I have eccormerce project on my page. Thanks for the suggestion 🙏

  • @mucizelerden
    @mucizelerden 9 месяцев назад +1

    was so great.
    Would you consider creating an e-commerce website?
    🙏🙏🙏
    It would be great with Angular spring boot and jjwt💯💯💯

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

      Yeah
      Thanks for the suggestion, it's a good idea. Will do that 🙏

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

      ​@@PhegonDev perfect 🙏🙏🙏

  • @pranavmohol9699
    @pranavmohol9699 3 месяца назад +1

    I am getting error that creat implement method for password also