.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/
Thanks, great content, easy to understand and follow!
Thanks a lot, for Explaining it simply 🤩
Thanks for watching!
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.
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?