Custom Authorization and Policy-Based Authorization in ASP.NET Core

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

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

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

    Thank you all for watching and for your support.
    ►► If you want to master Web API development using best practices, check out our Web API book: bit.ly/3x75ZMM
    ►► Also, to build great full-stack apps with Blazor, check out our course: bit.ly/3Pw3Y33

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

    Your videos are always amazing!

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

      Thank you so much! Glad you like the videos.

  • @imtiazdahar8451
    @imtiazdahar8451 9 дней назад

    Thanks for video.
    I have an assignment that Roles must be dynamic, means that in [Authorize(Roles = "Admin")] must not be constant, it can vary and dynamic (could be changed on runtime rather than putting hardcoded).
    How can I get list of roles for the user who is accessing the controller/action to check wether he/she is allowed to access or not.
    How can I achieve this, can you guide me or make a video on this?
    I would be very thankful.

    • @CodeMaze
      @CodeMaze  9 дней назад

      Hi. For your use case, you have to use claims and policies. When you have a kind of complex authorization logic with roles, you can't do that simply using the fixed attribute values. The policies will allow you a lot of flexibility and a custom code. Even though my video: ruclips.net/video/lYvF63SvS3g/видео.html doesn't cover your specific use case, maybe it can help you to get the global picture of how you can do it.

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

    Thanks, just what I needed!

    • @CodeMaze
      @CodeMaze  7 месяцев назад +1

      I'm glad the video was helpful. Thanks for watching.

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

    Dear Marinko,
    Thanks for sharing this useful concept, the question is, is it a good practice to implement this concept inside the CodeMaze structure?
    Thanks in advance.

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

      Hi. Yes, it is. If you need a custom authorization logic for any .NET project, you can use this solution.

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

    do you have github link for this example ?

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

      Hi. I don't have a Github link but the source code is part of the Patreon support program with other benefits.