Claims based authorization in Blazor Server

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

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

  • @MohammadAlbazel
    @MohammadAlbazel 2 года назад +1

    Thank you for your clear and detailed explanation.
    You can use the shortcut for formatting the code
    Ctrl+k, Ctrl+D

  • @Yozik2
    @Yozik2 2 года назад

    beautiful explained. many thanks

    • @Codewrinkles
      @Codewrinkles  2 года назад

      Thank you. This is one of the most underperforming of my videos and I'm glad that you found it and you think it was useful.

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

    I have issue which i want to save the branchcode on every login i tried localstorage it say prerender is enabled that issue is there a way in identity or something which can make this possible before i used jwt token and saving the branchcode in token but now in this i don't have any idea any help

  • @adam-xt8te
    @adam-xt8te 7 месяцев назад

    How about security of this kind of authentication/authorization? A lot of developers suggests better way is to use external tools like Firebase

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

    Is it safe to use userManager in Blazor components? I know that login has to be done using Razor Page because of httpContext which is not safe to use inside components, but If I want to do some user administration (add another user, list users, ....) or even change current user password, is it safe to do that in Blazor Server components or it must be done using Razor Pages?

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

      From my point of view it's not an ideal option, but it would be something you could live with if you know the caveats. The main problem here is that components might be long lived and there is no way to make sure that you create UserManager instances only when you need them and dispose them immediatiely afterwards. That's what IDbContextFactory makes possible.
      This being said, using the UserManager or other identity services in Blazor Server components might cause you the following issues:
      1. Concurrency issues
      2. "Entity already tracked" exceptions
      3. Other more imprevisible issues
      If you are ware of this and you think you can implement safeguard conditions to recover from such exceptions, then you can use it. Without these safeguards you will get a lot of exceptions.

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

    If you are making a query in the database, there is no sense in "ToLower", since the database is not sensitive to the registry

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

      Depends on collation settings CS = Case Sensitive CI= Case Insensitive you need to have one or the other. AS = Accent sensitive, AI = Accent Insensitive.

  • @ElCidPhysics90
    @ElCidPhysics90 2 года назад

    I’m looking for how to tell Blazor where folders are, like the Areas/Identity etc. I’m pretty sure you showed that in one of your videos but I cannot find it. It’s probably where you added the Login links. Can you point me to the correct video?

    • @Codewrinkles
      @Codewrinkles  2 года назад

      I think it's this one ruclips.net/video/LBByZRhyZ8U/видео.html

  • @waltkraybill5129
    @waltkraybill5129 2 года назад

    If you have Windows Authentication and want to use Claims instead of Roles/Group Membership, how would you add Claims to the User and use those claims for authorization?

    • @ElCidPhysics90
      @ElCidPhysics90 2 года назад

      He has a video dedicated to Claims. It’s very good

  • @jiM3op
    @jiM3op 2 года назад

    How do i use Windows Authentication with that? For example act on a group membership instead of a city claim?

    • @Codewrinkles
      @Codewrinkles  2 года назад +1

      If you have Windows Authentication set up in your project then you can achieve this by simply adding a polici with RequireRole("Daomain\\Group") and it should work. It would be something like:
      builder.Services.AddAuthorization(options => options.AddPolicy("MyRolOnly"), policy => policy.RequireRole("Domain\\Group")). That's how ASP.NET Core works in general. It is not related to Blazor in any way.

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

      dont be confused by Authentication vs Authorization, they are different animals

  • @DJosh-cs5vx
    @DJosh-cs5vx 2 года назад

    Thanks Code Wrinkles

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

    what about for example, when you need to authorize user to allow edit a product or not, what kind of logic we can apply ?
    BTW This is a Really nice content

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

      The Authorize component is used like the Authorize attribute in regular APIs. It means you can define custom policies and authorize each component by policy.

  • @dharmarajvedha9073
    @dharmarajvedha9073 2 года назад

    I am searching last one year for the topic 'Claims based authorization in Blazor Webassembly' but can't able to find out. Please provide tutorial for 'Claims based authorization in Blazor Webassembly and ASP.net MVC core Web API using JWT'. I am particularly asking for CREATE, DELETE and PRINT actions in a module. Actions buttons are provide corresponding to user. Please...

  • @MohammadKomaei
    @MohammadKomaei 2 года назад

    Blazor wazm authentication with login , logut and register : github.com/mammadkoma/attendance