Master Claims Transformation for Flexible JWT Auth in ASP.NET Core

Sdílet
Vložit
  • čas přidán 7. 09. 2024

Komentáře • 43

  • @MilanJovanovicTech
    @MilanJovanovicTech  Před 3 měsíci +1

    Want to master Clean Architecture? Go here: bit.ly/3PupkOJ
    Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt

  • @Cesar-qi2jb
    @Cesar-qi2jb Před 3 měsíci

    All your videos are right on time 🤩
    We use Microsoft Entra ID for authentication. However, we plan on building our own access control API and make use of claims transformations. We use Redis as cache.

    • @MilanJovanovicTech
      @MilanJovanovicTech  Před 3 měsíci

      I think this will be a great fit for your use case. Will you use Roles/Permissions, Policies?

    • @Cesar-qi2jb
      @Cesar-qi2jb Před 3 měsíci +1

      @@MilanJovanovicTech Policy-based authorization with permissions.
      Roles and Groups would be managed by our Access Control API.

  • @vamvdotnet
    @vamvdotnet Před 3 měsíci +1

    Excellent video! I learned a lot from you today :)

  • @baudeejay8592
    @baudeejay8592 Před 3 měsíci

    Inventory management with redis. I like you with it

  • @abdulmoiz2086
    @abdulmoiz2086 Před 2 měsíci

    interesting solution. the problem is that that this only works in a monolith.
    if you have 2 apis 1 .net and 1 python, then this logic will not work here. rather i think permissions should be part of the access token claims. in this way it won't matter what programming language I'm using, I'll be able to extract the permissions from the access token

    • @MilanJovanovicTech
      @MilanJovanovicTech  Před 2 měsíci

      Or they can both run the same logic and get the claims? In fact, you can cache the results in a distributed cache so the other API doesn't have to do any work

  • @HelloWorld-th9vb
    @HelloWorld-th9vb Před 3 měsíci

    Great content as always 💯

  • @SamFugarino
    @SamFugarino Před 3 měsíci

    Thanks Milan

  • @maacpiash
    @maacpiash Před 3 měsíci

    Great video. I just have one question: if I need to access the database in the claims transformation process, where should I do it? In the implementation of IClaimsTransformation interface, or in the permission provider class?

    • @MilanJovanovicTech
      @MilanJovanovicTech  Před 3 měsíci +1

      It's all the same. I'd put that in a service that I will resolve from the IClaimTransformation impl.

    • @orlandomco
      @orlandomco Před 3 měsíci +2

      He stated at 6:28 that you could replace GetSubscription with an API or Database call.

  • @user-xm7sh3vw8o
    @user-xm7sh3vw8o Před 2 měsíci

    Sorry, but what should be stored in Infrastructure and Persistence?

  • @haroldpepete
    @haroldpepete Před 3 měsíci

    great video, but in this case the normal user has the same permission than a user with a standard plan, he or she just need to be registered, even tough it was a great concept, you take the CreateScope and GetRequiredSerrvice from my comment?

    • @MilanJovanovicTech
      @MilanJovanovicTech  Před 3 měsíci

      It's a dummy example... The plan would be fetched from a database, for example.

    • @haroldpepete
      @haroldpepete Před 3 měsíci

      @@MilanJovanovicTech ok i got it, great video thank for sharing your knowledge with us, i really appreciate it

  • @10Totti
    @10Totti Před 3 měsíci

    Thanks best video!

  • @Paul-uo9sv
    @Paul-uo9sv Před 3 měsíci

    Good video

  • @RaZziaN1
    @RaZziaN1 Před 3 měsíci +3

    Really good video, except i dislike minimal api, but other than that great.

    • @MilanJovanovicTech
      @MilanJovanovicTech  Před 3 měsíci

      Thanks. Why do you not like Minimal APIs?

    • @AhmarHusainn
      @AhmarHusainn Před 3 měsíci

      Its only about adapting to change😊

    • @rodilife
      @rodilife Před měsícem

      The setup process for using Minimal API in production is tiresome. It's either Controllers or FastEndpoints, one of the best libraries in the ecosystem right now. FastEnpoints is what minimal API’s should have been.

  • @rusektor
    @rusektor Před 3 měsíci

    How does this differ from ClaimsPrincipalFactory?

  • @EvekoShadow
    @EvekoShadow Před 3 měsíci

    Does this work well with dynamic claims? Let’s say a CreateOrder Claim but said user can only create them for his department

    • @MilanJovanovicTech
      @MilanJovanovicTech  Před 3 měsíci

      I think you'd need to have auth in the use case as well

    • @EvekoShadow
      @EvekoShadow Před 3 měsíci

      I would love to have middleware that can consume the first part of a url param to determine authorization… api/{departmentid}/{createorder}, now we have to determine authorization in endpoint itself.

    • @MilanJovanovicTech
      @MilanJovanovicTech  Před 3 měsíci

      @@EvekoShadow That's resource-based authorization, which is a bit different.

  • @user-xm7sh3vw8o
    @user-xm7sh3vw8o Před 3 měsíci

    我想知道 Infrastructure 和 Presentation 中应该存储哪些内容?

    • @MilanJovanovicTech
      @MilanJovanovicTech  Před 3 měsíci

      Check this out: czcams.com/video/TQdLgzVk2T8/video.html

    • @user-xm7sh3vw8o
      @user-xm7sh3vw8o Před 2 měsíci

      @@MilanJovanovicTech Sorry, but what should be stored in Infrastructure and Persistence?

  • @amaechinaikechukwu8266
    @amaechinaikechukwu8266 Před 3 měsíci

    I want to know as much as you