.Net 8 API Role Based Authorization

Поділитися
Вставка
  • Опубліковано 8 вер 2024
  • Learn how to add role based authorization to your .Net 8 API using the IClaimsTransformation interface. This is a great way to protect your .Net API routes based on whether your user has specific roles.
    Microsoft docs for IClaimsTransformation:
    learn.microsof...
    Github Repo with code from this video:
    github.com/Scr...
    Follow me on social media!
    Instagram: / scriptbytes
    Threads: www.threads.ne...
    Check out my blog!
    scriptbytes.io/

КОМЕНТАРІ • 5

  • @artemvolsh387
    @artemvolsh387 5 місяців тому +1

    Thanks, great content, easy to understand and follow!

  • @don_kavindu_prabhashitha
    @don_kavindu_prabhashitha 3 місяці тому

    Thanks a lot, for Explaining it simply 🤩

  • @waynehawkins654
    @waynehawkins654 2 місяці тому +1

    Nice. Love to see how to use JWT into this. I watch many videos and I always get a 404 not found. I sign in, and the API returns the JWT. I sigin into the API (top right) with Bearer {and token id}. And then try to access a Authorize http and bingo - I get 404 not 200 or 401. I'm going slowly crazy.

    • @scriptbytes
      @scriptbytes  2 місяці тому

      That is a little weird. I'm not sure why you would get a 404.
      If you add [AllowAnonymous] to whichever endpoint you're calling (just for a quick test), does that change anything?