.NET 6 Web API 🔒 Read JWT Authorization Claims of a User (from a JSON Web Token)

Поділитися
Вставка
  • Опубліковано 2 лис 2024

КОМЕНТАРІ • 56

  • @PatrickGod
    @PatrickGod  2 роки тому +14

    ▶ [Part 1/4] .NET 6 Web API 🔒 Create JSON Web Tokens (JWT) - User Registration / Login / Authentication: ua-cam.com/video/v7q3pEK1EA0/v-deo.html
    ▶ [Part 2/4] .NET 6 Web API 🔒 Role-Based Authorization with JSON Web Tokens (JWT): ua-cam.com/video/TDY_DtTEkes/v-deo.html
    ▶ [Part 3/4] .NET 6 Web API 🔒 Read JWT Authorization Claims of a User (from a JSON Web Token): ua-cam.com/video/fhWIkbF18lM/v-deo.html
    ▶ [Part 4/4] Refresh Tokens with a .NET 6 Web API 🚀: ua-cam.com/video/HGIdAn2h8BA/v-deo.html

  • @brandon-mr3ip
    @brandon-mr3ip 2 роки тому +7

    Great Tutorial Patrick, could you please do a tutorial were you combine all this with the Code First Approach tutorial, Registration Login to then accessing methods to create our characters based on the Roles that user has

  • @johnmoseley4827
    @johnmoseley4827 2 роки тому +1

    I really enjoy your short concise videos, a suggestion..... If I should stumble across your video in UA-cam I would like to have a link to part 1 and part 2... maybe?

    • @PatrickGod
      @PatrickGod  2 роки тому

      This is actually a really good idea. 😅 I should definitely add the other parts to my videos. Thank you!

  • @mdshaheenhossain5369
    @mdshaheenhossain5369 2 роки тому +1

    Liked it before watch. well explained. thank you

  • @chinedumbah1434
    @chinedumbah1434 2 роки тому +1

    Your videos helps alot. Thanks.

    • @PatrickGod
      @PatrickGod  2 роки тому

      Glad to hear that! Thanks! 😊

  • @TechnicalVibs
    @TechnicalVibs Рік тому +1

    wonderful tutorial

  • @guillermomazzari8320
    @guillermomazzari8320 Рік тому

    Thanks bro, great tutorial!

  • @fredrikmoller3275
    @fredrikmoller3275 2 роки тому +5

    Amazing videos! could you make a video about how to implement an "account locked for y mins after x amount of failed login tries" with jwt :)

    • @PatrickGod
      @PatrickGod  2 роки тому +1

      Great idea! Let me add that to my roadmap. Thanks!

  • @shucaybmili
    @shucaybmili 2 роки тому +2

    for the nullable properties, just edit your csproject file and Remove the enable tag

  • @vamvdotnet
    @vamvdotnet 2 роки тому +3

    Great job, Patrick! One more excellent video of yours! If I may, I'd like to suggest you to create a YT tutorial about authorization policy factories, explaining when and how to implement. Keep up the good work and congrats :)

    • @PatrickGod
      @PatrickGod  2 роки тому

      Thank you so much! Added your suggestion to my list. ☺️

  • @marcotruncellito
    @marcotruncellito 2 роки тому

    Great Tuorial, thank you!

  • @raphaellukas3328
    @raphaellukas3328 2 роки тому +1

    Vielen Dank für ein weiteres tolles Video :-)

  • @karlopest9288
    @karlopest9288 2 роки тому

    Fantastic explanation!

  • @Febrianian
    @Febrianian Рік тому

    Hii Patrick, im follow this couse full section from skillshare "Authentication course". I have one question, if there already custon table for user registration iclude roles and generate token, how to read in client side with httpclient to retrive that token has include roles for authorization.
    Can you suggest to me how to do it
    Im done with consume web api from client for login and get that token, but not success for authorization
    Or anybody can help me, thanks before.

  • @sebastianp2810
    @sebastianp2810 Рік тому

    Hi, is it posible to use authoritzation based on claims without identity?

  • @grumpydeveloper69
    @grumpydeveloper69 2 роки тому +2

    Loved the video.
    I like swagger but while developing and testing it slows you down. Instead of calling swagger have you worked with tools like postman, insomnia or the vs code plugin rest-client. They speed up calling api endpoints and even allow you to chain multiple calls and re-use thair responses. It could really simplify some of the demo calls you make.

    • @PatrickGod
      @PatrickGod  2 роки тому +8

      Hey Johan, Thanks for your feedback. That's funny, actually. I used Postman a lot. But with the release of .NET 5, people wanted to see more of Swagger, because it was kinda built into the .NET 5 example projects. However, you're right, Postman or the other tools are definitely worth it. Personally, I really like all the options in terms of profiles, configs, bookmarks, and so on, Postman provides. Maybe I should make a little video comparing Swagger and Postman.
      Now that I'm writing this, I think Swagger is great because you get an API documentation out-of-the box, but Postman is sometimes better in regards to testing your calls because you can save them, configure them, and so on.
      Hope this makes sense. Thanks again!
      Take care,
      Patrick

    • @calwayNL
      @calwayNL 2 роки тому +1

      @@PatrickGod A comparison is always a good idea for a video. I like the vscode extension rest client because it is very easy to include the document in source-control. Both Postman, and my preferred too Insomnia have the ability to save projects/workspaces, but the files are stored in their location, not where my solution source lives. The things you mentioned, "profiles, configs, bookmakrs..." are all possible with rest client, you might want to check it out also.

    • @nelsonrivers8546
      @nelsonrivers8546 2 роки тому

      I recently used VS Code with the ThunderClient Extension installed. It is more lightweight, and you can create collections, and test a Web API. It works very well. Postman can be memory-intensive if you have other apps open on your machine.

    • @boukman3668
      @boukman3668 2 роки тому +1

      @@PatrickGod I see that you haven't created a list with this on your channel. Im struggling to follow the order of the videos.

  • @nicolass8941
    @nicolass8941 2 роки тому +1

    Great and usefull !

  • @tehwabbbit
    @tehwabbbit 2 роки тому

    This has been a great tutorial, incredibly clear!
    Would you still reccommend doing this custom rolling of auth vs using something like ASP Identity Core? This seems very straight forward and keep thinking I am missing something!

  • @dangkhoaphung9454
    @dangkhoaphung9454 Рік тому

    thanks you so much

  • @8294685725
    @8294685725 2 роки тому

    Initially take a thanks

  • @goditto5694
    @goditto5694 Рік тому

    Hi? Thank you a lot for this video. I need one lecture. Making a db table through blazor dynamically. I tired with onmodelcreating method, but it seems not working. I would like to create each year's table for class members through blazor admin page, then members do CRUD things. May I ask?

  • @friendlyfox2189
    @friendlyfox2189 2 роки тому +1

    wow Thank you

  • @_MoshikoAz_
    @_MoshikoAz_ 2 роки тому +1

    if i make a controller for role "user" and there's get user personal data,
    is there a way for user role to avoid getting someone else data, even tho they have the same role ?

    • @PatrickGod
      @PatrickGod  2 роки тому

      Hi there. I'd suggest looking for the user with the given ID. Since we get the role from the JWT, for instance we could also put the User ID in the JWT and read it again in the controller. Hope this helps!

    • @_MoshikoAz_
      @_MoshikoAz_ 2 роки тому

      @@PatrickGod best practice would be to do it through a service ?

  • @nisalbandara
    @nisalbandara 2 роки тому +2

    Patrick can you please make a project management system(like trello or jira but simple) using blazor. Much Appreciated !!!

    • @PatrickGod
      @PatrickGod  2 роки тому +3

      This is an amazing idea! A big project, though, but still an amazing idea. Let me think about that, and maybe add a poll in the community tab, because I've got a couple of similar ideas. 😊 Hope you're going to vote. Take care, Patrick

  • @xavier1572
    @xavier1572 2 роки тому +2

    Hi sir nice tutorial thank you please make a video on asp .net core web API and react j s with graphql please 🙏

    • @PatrickGod
      @PatrickGod  2 роки тому +1

      Thanks Xavier. I added it to my list. ;)

  • @luisfernandodeolazabalsche3317
    @luisfernandodeolazabalsche3317 2 роки тому +1

    Muchas gracias ;-)

  • @nagarajutirumalasetti2473
    @nagarajutirumalasetti2473 Рік тому

    great job patrick ,could you please connect this project with database like sql server , we can take data from db and insert username pasword in db

  • @zakariyapindhariya7146
    @zakariyapindhariya7146 2 роки тому

    Can you guide how to implement RefreshToken in .net Core 6.0 API?
    I Refer this video and Previous Video For Authentication and Authorization

  • @kuschizu1280
    @kuschizu1280 2 роки тому +1

    Hey! How about a tutorial authorization with jtw and roles ?:D

    • @PatrickGod
      @PatrickGod  2 роки тому

      This one is for you: ua-cam.com/video/TDY_DtTEkes/v-deo.html 😉

  • @rameshchandan5720
    @rameshchandan5720 Рік тому

    I used this code and got 2 issue, first it is unable to fit the key byte size another JWTtoken is invalid.

  • @muhammadsobhy3394
    @muhammadsobhy3394 2 роки тому +1

    i want confirm email and forget password with jwt token

    • @PatrickGod
      @PatrickGod  2 роки тому +1

      Good idea, thanks for the feedback!

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

    what is the meaning of your name.

  • @Liootas
    @Liootas 2 роки тому

    .net 6.0 gives these null warnings

  • @jseh_
    @jseh_ 2 роки тому

    the jwt decoded in httpcontext.user has already been validated? the expiration date?