Spring boot 3 & Spring security 6 - Roles and Permissions Based Authorization Explained!

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

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

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

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

  • @maryamalsulaiman3321
    @maryamalsulaiman3321 Год назад +19

    After watching a lot of videos, I can say you are the best one who explains it very smoothly and clearly 🤩 Thank you Alibou for your hard efforts 🙏

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

      thank you so much for the nice comment. really appreciate that

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

      ​@@BoualiAli Hi bouali, I have a question. I am currently working on a project that requires to store the roles and permissions in a database. In this case, how can we apply and use the stored permissions in the database to authorize the actions? 🤔

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

      I also have the similar requirement. Guide me on how this was implemented if already done.

  • @SteveT-tg4eb
    @SteveT-tg4eb 8 месяцев назад +4

    what if the role needs to be dynamic meaning not only tied to ADMIN, MANAGER ? is there a good way to handle it?

  • @АлександрСиницын-р1у
    @АлександрСиницын-р1у 8 месяцев назад

    Thank you for the video
    I think the main concept here is that a role is a container for permissions

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

    Thank you so much, you are making the life easier.

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

    T'es vraiment trop trop fort, c'est incroyable

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

      Really happy you liked it

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

    Jus occupied with some school work but once done I will follow. I love your content bro. God bless you

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

      Really to have you with us. I will keep posting more and more content.
      A lot is coming in different areas not only spring

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

    One of the best tutorials out there!!

  • @grabieldelanieved.380
    @grabieldelanieved.380 3 месяца назад +2

    i'm wondering if this video belongs to a playlist 'cause i see that when he start de videeo already has some code there, so please share the link to start from the begining with this wonderful example, thanks for the greate knowledge

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

    I have been waiting for this video for a long time. Thank you ❤

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

    You have the outstanding tutorials, çok teşekkür ederim kardeşim

  • @Кыргызстан-менинмекеним
    @Кыргызстан-менинмекеним 11 месяцев назад

    Great tutorial, thanks very much. I was just searched role and permission based security

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

      Glad it helped

  • @egbe-iyonmichael5119
    @egbe-iyonmichael5119 Месяц назад

    Thanks, would like a course on debugging with IntelliJ

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

    better clearance and better understanding, thx

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

    Great video and explanation. Personally i prefer the PreAuthorize annotation on methods - to have a grainer control for the endpoints. But as Ali mentioned - it depends on what you want to achieve and how it works for you.

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

    Thank you very much sir Ali ♥️, could you make us a video on the front-end using angular🙏.

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

      Really happy you liked it
      Already working on it

  • @trevtechofficial
    @trevtechofficial Год назад +3

    Great video, great content.Kindly next time we can make the roles and permissions configurable so that different actions can be assigned to different roles via an endpoint for scalability.

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

      I will note that for the coming video

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

      @@BoualiAli I appreciate.Good stuff man.

  • @monirzaman5366
    @monirzaman5366 6 месяцев назад

    Learned lot of things. Thanks a lot

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

      Glad to hear that!

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

    Thank you Alibou for amazing contents! Please make a video about "Auditing entities in Spring boot".

  • @swipped99
    @swipped99 6 месяцев назад

    Great tutorial as usual!

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

      glad you liked it!

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

    This content is amazing Sr. Thanks.

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

      Glad you enjoy it!

  • @abu-dukhan
    @abu-dukhan Год назад

    Maasha Allah, Wollah I'm just so so happy that I don't even know what to say.
    Thank you so much Alibou, this is exactly one of the things I wa thinking to add to my app and Boom 💥 here is it.
    Waiting for the Swagger docs 😁
    Thank you so so much, JazaakAllahu khairan ❤

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

      Swagger docs is published now 😁
      Perfect timing

  • @HemanthReddyNagireddy-g2u
    @HemanthReddyNagireddy-g2u 7 месяцев назад

    Great video! Could you also make a small video on the intellij shortcuts to cut down our development time like the one you used to replace the word on multiple lines at a single time?

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

      I will create a short for that (reel)

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

    congratulations, your videos are much more informative than many courses, a hug from brazil

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

      Thank you 🙏
      Really appreciate that

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

    It would be great if you could make a video on how to debug. Your explanations and your code are the best. Thanks for making Spring understandable!!

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

      I will create one ASAP

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

      I really need that

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

      @@codeduel the video is already published.
      Enable the notifications so you won’t miss any new video

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

    Would love to see user management and authentication with Keycloak

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

      Already preparing the content

  • @user-ex3ek9rf2u
    @user-ex3ek9rf2u Месяц назад

    Awesome, but where is the full video link?

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

    thank you so much Alibou I learned a lot you are the best

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

    Awesome video I really appreciate you ,
    can make video how to create dynamic role and permission which admin user can change it anytime for any endpoint dynamically

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

    Awesome as always.... Debugging Video please

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

      Already published.
      Enable the notifications for next times

  • @anurag-sachan
    @anurag-sachan Год назад

    Great Job Brother, Tried watching different videos to get better understanding, but yours was too good. Also, Your debugging part was impressive, consider making a video on it too.

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

      Already published a video on debugging.
      Go check it in my channel

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

    Thank you, one of the best tutorial on Permissions and Roles I have ever seen. Please create a new tutorial about how to implement granularity and hierarchy of each role. Let's say I have list of 1000 companies from 100 countries, I would like an user responsible for updating ONLY companies from Germany, while other ONLY from USA, and UK . How would you do it? Would you create 100 Permissions? for each country?

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

      Glad you liked it!

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

      What is the answer for the question ?

  • @ВолодимирЖуківський

    Сподобалося відео! Дякую

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

      My pleasure. thank you so much for you feedback
      (I use translations to understand it lol)

  • @bearsenseii
    @bearsenseii 11 месяцев назад

    THANK YOU SO MUCH I VE SEEN YOU !! U R GREAT

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

      You are so welcome!

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

    COUPON Code: *EARLYBIRD20* => Spring Data J PA course: aliboucoding.com/p/the-full-guide-to-master-spring-boot-data-jpa

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

    please make a video handle the security exceptions. cause the right resource pretty much missing on the internet

  • @deeplife9654
    @deeplife9654 8 месяцев назад +1

    I am having a hard time to follow your video. Which order I should watch the video of Spring security series ?

  • @alfrendosilalahi6652
    @alfrendosilalahi6652 Месяц назад +1

    Hi @BoualiAli, I am a bit confused for permission, Why on getAuthorities() method on Role enum, we define SimpleGrantedAuthority with Permission.getPermission(), but on SecurityConfig we define hasAnyAuthorities() with Permission.name()? How it work? I don't really understand, thank you

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

    like, brb later. Who is the man? You are the man

  • @argjendzuka6289
    @argjendzuka6289 2 месяца назад

    Hey @BoualiAli, are you going to do a video with debugging in IntelliJ?

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

      already done. search in the channel and you will find it

  • @luxekochannel
    @luxekochannel 11 месяцев назад

    Great video. U help me alot

  • @devozs
    @devozs Год назад +4

    Great video, thanks for that and for the rest of your Spring tutorial.
    Would be great if you can combine this Roles and Permissions Based Authorization together with Oauth2 and show how the provider (i.e. google) goes together with user, roles and permissions entities.

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

      I’m already preparing a video about keycloack that will cover all that

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

      @@BoualiAli thanks!
      keycloack sounds great, you mean it will also allow Oauth2?

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

      @@devozs yes

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

      @@BoualiAli man, I was searching a video like this, and I just read this comment! With the quality of your content the wait will be worth it!

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

      @@UnknownUser77839 you will absolutely like the content

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

    thanks a lot Ali ! This was very helpful

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

    Thanks for the video. I am interested in a video about debugging.

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

    great video thank you so much

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

    I LOVE YOU! THX for the video

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

    Thanks for this awesome tutorial, please when are you doing the tutorial on debugging as you said in the video using Intellij, thanks.

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

      Already published sometime ago.
      Enable the notifications, I'm always saying that so you don't miss any videos

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

      @@BoualiAli Thanks much

  • @ramiro.sarasola
    @ramiro.sarasola Год назад

    You are the best man

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

    Thanks for this video Ali. A master class as always ❤‍🔥❤‍🔥❤‍🔥

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

    another awesome helpful video 💪

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

    Thank Sir, Plz include with the jwt Exception too

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

      Check the exception handling video. it wil help you

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

    Thanks for your videos, you provide AWESOME content in great depth. IF you can also do project based videos like e-commerce,learning management system, content management system so that we get a full scope to how to do projects,Thanks again

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

      I'm already working on a new course.

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

      @@BoualiAli A simple User Management System will be perfect! :)

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

    Really apreciate it! Super well explained.

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

    Great video. Have developed a video on Debugging on Intelij IDEA?

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

    You're the best!

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

    Hey, first and foremost, I want to express my gratitude for your time and the incredible effort you put into creating quality content for us. Your tutorials have been immensely helpful in my learning journey. I am currently working on a project where I would like to incorporate JWT (JSON Web Tokens) into my Spring Boot/Angular application. After conducting extensive research on the subject, I couldn't find anything that clarifies the concept and its implementation better than your videos.
    If possible, I kindly request if you could expedite the creation of a tutorial that demonstrates the integration of JWT in both the backend (Spring Boot) and the frontend (Angular). I truly value your expertise, and having your guidance in this particular area would be invaluable to me. I understand if this request might be challenging or time-consuming, so please let me know if it is feasible within a reasonable timeframe.
    Lastly, I would like to mention how much I appreciate your channel and the valuable insights you consistently provide. Your tutorials have been instrumental in deepening my understanding of various concepts, and I truly admire your teaching style. Thank you once again for your dedication and contribution to the learning community.

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

      I really appreciate your comment and how motivating it is.
      I'm already working on an angular course that should be released soon. I will cover almost everything in it

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

      @@BoualiAli thank u sir , we are impatiently waiting.
      Thanks for ur time once again

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

    Nice Video. In the video u mentioned about earlier video about User. Can u pls provide the link for the same

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

      check the playlists

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

    @Boulaali Ali ---- Can we handle roles or add new roles to system/app from db or file etc.. dynamically may be from UI etc. with our restarting application in Spring Boot. And also needs to apply these ne roles and permissions on ui pages as well with easy. Please consider PhpRad application where we Can define roles to existing pages from UI

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

    Great tutorial, We need intellij debugging video with your secret tips ❤😍🔥

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

      Already done.
      Subscribe and enable the notification so you won't miss any new video

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

      already done 🤩 thank you again ❤️

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

    thank you mate

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

    The best, Thanks

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

      Thank you too!

  • @JamesPenner-c9m
    @JamesPenner-c9m 5 месяцев назад

    What design pattern would you suggest to use to overlay this program?

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

    Hey, could you do a video about this jwt and add angular please.

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

    Great content.
    Please make a video on debug in intelliJ.
    Thanks

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

    Authorize using azure ad ... Manage permissions in local database

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

    I hope this message finds you in good health. I would like to express my deep appreciation for discovering your channel, and I am truly grateful for the valuable content you provide. Your work has been immensely helpful to me. I do have a question that I would like to pose.
    As a novice in the field of Spring Security, I am wondering if it would be beneficial for me to watch your previous video titled "Spring Boot 3.0 - Secure your API with JWT Token [2023]" as a starting point. Is this video considered a foundational resource that would aid in better comprehension before proceeding further?
    Thank you for your continuous efforts, and I eagerly anticipate your response.

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

      I really appreciate your comment and feedback and I'm always happy to help.
      the answer is yes, start with that video, the the logout video, after that the refresh token video and finally this one.
      I will post a video combining all the security tutorials I created so you can have a full one

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

      @@BoualiAli thank you for your answer , this is what I'm currently doing.
      thank you for your help again and for your time
      .

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

    Hello, and thank you for the excellent course and quality content on your channel.
    I've been following the series for a while, making some adjustments to fit my directory structure and architecture, but nothing significant. However, I'm encountering a problem where, regardless of the role I use, I get a 403 error when accessing the DemoController. The roles and permissions code is identical (I made sure to copy and paste your code from the repository), yet the issue persists. The console output correctly identifies the user role and details, but the 403 forbidden error persists.
    Did I overlook something? Perhaps I missed a detail or misunderstood a part of the instructions. What steps can I take to debug this issue? Many thanks in advance.
    P.S.: I apologize if my English isn't perfect; it's not my native language.Hello,

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

    Hello~ thank you for sharing your tutorial! I appreciate it!. I just followed your code in spring security. I just have a problem which are not allowed different kind of users for login. I have no idea why.

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

      Can you explain a bit more please?

  • @divyanshsaini1077
    @divyanshsaini1077 11 месяцев назад

    can we implement authorisation at the Gateway level? this will reduce changing a lot of code in the application in the downstream of Gateway.

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

    Can you explain to us how to make a many to many relationship (many users has many roles)?

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

      Check the spring data jpa playlist

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

    Thank you for uploading such important educational video.. sir please upload Oauth 2.0 complete course, how can manage resource URL to Authorised for different particular user(role-base Authorization using OAuth2). And your all videos are deserving to get five star feedback.

  • @DattatrayBharde-v1f
    @DattatrayBharde-v1f Год назад

    Nice video, but How to use this service for multiple microservices. to provide authentication as per role.

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

    very good.

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

    It was a very helpful video. One thing I wanna ask is that if we have two different entities lets say buyer and seller which have there own controllers and repositories then how will we be managing their repositories in ApplicationConfig. Thanks and waiting for a reply

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

      Can you please explain a bit more, I didn't get the topic

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

    Many thanks for this!
    Just one thing puzzles me, why do you include ADMIN_* permissions in hasAnyAuthority of requestMatchers(*, "/management"), wouldn't it work already if you just included MANAGER_*?
    I think you defined the admin role as containing all the manager permissions, wouldn't that be sufficient already?

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

      thank you.
      I need to double check the code. I forgot honestly

  • @86Saurabh1
    @86Saurabh1 Год назад

    Great video as it explains Authorisation in more details. I am having an issue when I am trying to add a new role after the data has been loaded to MySQL DB. So if I create a new role "READ_ONLY" , and add that role during service call, I get 403 Error with message that "Data truncated for column 'role' at row 1". Now if I use "ddl-auto=create-drop", then it will work because this will always pre-populate the Role values from scratch but if I am using "ddl-auto=update", and add new Role like mentioned above, I will get the above error. Not sure if this is happening with MySQL only.

    • @86Saurabh1
      @86Saurabh1 Год назад

      One walkthrough is to add a new value like "READ_ONLY" to the columns directly in the database. But that won't be good practice for Production DB.

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

      Check the data compatibility: type, length,...

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

    If you face this error -> Access denied and loop error issue,
    after creating get user request/update user.
    Watch Bouali's video titled 'How To Fix Infinite Recursion Loop in Spring Boot'.
    Thanks, Bouali.

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

      thanks for sharing

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

    Very nice and clear video. I also wanted to ask is it common in java that the permissions are hard coded and not stored in db for an example. I see many people doing this approach, but didn't come across any that used db to store user permissions.

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

      Yes if you have already all the scopes predefined. Otherwise it can be stored into a database to make more dynamic and scalable.
      I will try to make a video explaining that

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

      @@BoualiAli that would be amazing to see, hopefully we can see that video coming to light.

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

    Question
    In your video 42:10min above of AdminController class you used @PreAuthorize("hasRole('ADMIN')")
    Now you deploy your code it works fine but In database I added another role called "SUPER_ADMIN"
    And want to apply in the AdminController then is it possible to achieve without deploying the app with the value like
    This @PreAuthorize("hasRoles('ADMIN, SUPER_ADMIN')") hardcoded with controller
    1. I don't want to deploy I will assign any ROLE to ANY USER using UI click it will save database
    2. I don't what to use @PreAuthorize as hard coded without using @PreAuthorize I will check api URL and check user
    has permission to access that in each request.
    How I may achieve that any IDEA
    Moreover I found ROLE in spring security is simple STRING it don't allow any custom object as my own defined
    It's a huge obstacle to build custom security

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

      If you add a new role to your application ==> this means that you have new requirements / logic. So it makes sens change the code, write tests, ....

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

      ​@@BoualiAli Thanks for the reply brother ... it's not always true that (If you add a new role to your application ==> this means that you have new requirements / logic) but for now I agree to with you but I don't to hard code like this { @PreAuthorize("hasRole('ADMIN')") } it will apply on fly I mean run time when request enters in the method. on the other hand spring security role only takes string and all it's implementation it's another barrier to customise it smoothly. By the way Thanks you and Take Care bro

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

    in 9:28 what is the shortcut that did u use ?

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

      All the shortcuts that I use are displayed in the green popup

  • @rehamalmutairi184
    @rehamalmutairi184 6 месяцев назад

    What the differences between role and permission? and can I use role only to meet the authorization requirement ?

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

      they are almost the same.
      Permission and more granular comparing to roles.
      Roles are global, meanwhile permissions are specific to user actions (who can do what)
      You can use only roles to meet the auth requirements

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

    Please add video on debugging

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

    Hi Ali, Great tutorial. I was wondering, if I wanted to implement a situation where the manager can grant or revoke permissions to admins i.e have a table of permissions mapped to a user(admin) and the manager can add and remove permission to different resources from the admins permission list. How do I go about this instead of hardcoding the resources that all admins should be able to access. Thanks again for this lesson.

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

      You can store them in a database or use OAuth2 instead and it will handle everything for you

  • @tariqelhachhach8489
    @tariqelhachhach8489 12 дней назад

    Can u complete this on the angular side

    • @BoualiAli
      @BoualiAli  12 дней назад

      already available in Book Social Network playlist

  • @SiddharthLodhi-x1v
    @SiddharthLodhi-x1v Месяц назад

    the issue is that once a request matches a specific role(like ADMIN), it doesn’t proceed to check the authority(ADMIN_CREATE). This happens because Spring Security stops processing further matchers once it finds a match. so i think only the permissions should be there in the granted authorities and in request matchers.
    Also you have made mistake in Roles enum where in authorities you are returning {new SimpleGrantedAuthority(permission1.getPermission()) as list } but in Request matchers its Permission.name() .

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

      The order of the matchers really matters. So this is why you get this behavior

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

    Finally!!

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

    I love your video

  • @sengdaooudomsinh947
    @sengdaooudomsinh947 16 дней назад

    does anyone know where can I find the prior video before this vdo that he refers to? thx

    • @BoualiAli
      @BoualiAli  16 дней назад

      in the spring security playlist

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

    Right here I think there is a mistake that is you can get even refresh token with access token, I don't know maybe

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

    Is there a way to handle permissions in keycloak?

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

      Yes, check the keycloack video

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

    Thanks so much, boss, I'm a bit skeptical about what and while we need to seperate authority i.e (admin:create, admin:delete etc.) , are you saying if i use (admin:create) on all the endpoint(methods), i will not be able to access the resources? Like. Thnaks

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

      it always depends on you needs and business rules

  • @giorgosdimitriou-s4u
    @giorgosdimitriou-s4u Год назад

    hello alibu and congratulations for the perfect job. I build a rest api and i have an entity called event. I use command objects for response and i am wondering how i can implement the authorities because for example in a Get ~/event/ request if user is admin I need to return adminEventCommandObject if use is HR i need to return hREventCommandObject etc.

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

      Can you please post in the discord server?

  • @PriyanshuThakur-k3h
    @PriyanshuThakur-k3h Год назад

    very nice tutorial, but I have a doubt that how to give permissions dynamically like if a new user added to the system then how to give roles and permissions to that user?
    if any one know please let me know ):

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

      I will make a video for that too, soon

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

    When user forgot password, How can they reset their password?. I hope you make this tutorial.

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

      Already done, search in the channel

  • @onaodowanaugustine5088
    @onaodowanaugustine5088 6 месяцев назад

    I just found GOLD..........Thank you for this @BoualiAli

  • @sayedalisinasadat2908
    @sayedalisinasadat2908 2 месяца назад

    great , i want access all users from user controller it is not working code is correct , for custom controller working please check if we want access all users is it working or no ?

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

    In this particular use case when I am already using role do I need add permissions anymore? Is it not redundant?

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

      check my github account

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

    How can we utilize this microservice with Spring Cloud Gateway and share user details and user authorization among other microservices?

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

      Nothing special, just implement it on the API Gateway level

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

    Hello! I attempted to follow your instructions and had some success. However, when I tried to use the @PreAuthorize annotation in either the admin or management controller, I consistently received a 403 error (the previous requestMatchers worked fine)

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

      Did you add the annotation to enable the @PreAuthorize?

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

      @BoualiAli, my bad. I forgot to enable the method. Thank you very much!

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

    sir make a video for jwt exception handling

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

      Already done. check the playlist

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

      @@BoualiAli bt how do we handle exception for all jwt services

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

      @@pujanshrestha5900 i already explained how to handle exceptions. Jwt exceptions are not special exception they can be handled in the same way