JSON Web Tokens (JWT) in .NET 8 Web API 🔒 - User Registration / Login / Authentication

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ต.ค. 2024
  • JSON Web Tokens (JWT) in .NET 8 Web API 🔒 - User Registration / Login / Authentication
    In this tutorial, we will discuss about the implementation of JWT authentication in asp.net core 8.0 with example.
    A JSON web token(JWT) is JSON Object which is used to securely transfer information over the web(between two parties). It can be used for an authentication system and can also be used for information exchange. The token is mainly composed of header, payload, signature. These three parts are separated by dots(.)
    Header
    A header in a JWT is mostly used to describe the cryptographic operations applied to the JWT like signing/decryption technique used on it. It can also contain the data about the media/content type of the information we are sending.
    {
    "typ":"JWT",
    "alg":"HS256"
    }
    Payload
    The payload is the part of the JWT where all the user data is actually added. This data is also referred to as the ‘claims’ of the JWT. This information is readable by anyone so it is always advised to not put any confidential information in here.
    {
    "userId":"b07f85be-45da",
    "iss": "provider.domai...",
    "sub": "auth/some-hash-here",
    "exp": 153452683
    }
    Signature
    This is the third part of JWT and used to verify the authenticity of token. BASE64URL encoded header and payload are joined together with dot(.) and it is then hashed using the hashing algorithm defined in a header with a secret key. T
    JWT Example :
    header:
    {
    "alg" : "HS256",
    "typ" : "JWT"
    }
    Payload:
    {
    "id" : 123456789,
    "name" : "Manoj"
    }
    Secret: manojdeshwal
    JSON Web Token
    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTIzNDU2Nzg5LCJuYW1lIjoiSm9zZXBoIn0.OpOSSw7e485LOP5PrzScxHb7SR6sAOMRckfFwi4rp7o
    Tools Used: Visual Studio 2022, Swagger and Postman
    ☕ Buy me a Coffee (Channel Support through Donation)
    www.buymeacoff...
    📻 Recommended Courses
    ➤ React Ecommerce Tutorial : • React Ecommerce
    ➤ React JS Tutorial : • Reactjs
    ➤ React Router Tutorial : • React Router Tutorial ...
    ➤ Convert Html Template in Reactjs : • how to convert html te...
    ➤ ASP.Net WEB API Tutorial : • ASP.NET Web API tutori...
    ➤ SQL SERVER Tutorial : • SQL Server Tutorial Fo...
    ➤ HTML Crash Course: • HTML Crash Course For ...
    ➤ Payment Gateway Integration : • CCavenue Payment Gatew...
    ➤ WEB API With SQL SERVER : • ASP NET Web API with S...
    Subscribe to this channel
    ➤ bit.ly/2IaMZUr
    Must buy Programming Laptops :
    amzn.to/3AlLH03
    amzn.to/3QQrgiz
    amzn.to/3RaqBIQ
    amzn.to/3R1EmJS
    amzn.to/3QHU9gZ
    amzn.to/3QNcAkk
    amzn.to/3QKtzno
    amzn.to/3dTMbmm
    amzn.to/3dQJ7aG
    Share, Support, Subscribe Now :
    TH-cam 🎥 : / manojdeshwal
    Instagram 📷 : / openprogrammer
    Twitter 🐦 : / openprogrammer
    Facebook 👍 : / openprogrammer
    Website 🌐 : www.connectedp...
    ⭐️Tags : ⭐️
    #JWTToken
    #.netcoretoken
    #.netcorewebapitoken
    ⭐️ Your Queries : ⭐️
    How to setup JWT authorization in asp.net core 8 with swagger in hindi || Jwt authorization with swagger in hindi || JWT atuhentication in hindi ||
    JWT authentication in hindi with swagger || asp.net core 6 version jwt authorization token with swagger ||
    JWT Authentication in asp.net core 8.0 with swagger Enable JWT authentication enable in swagger JSON Web Token Introduction ||
    How does JWT authentication work? || What is JWT authentication in REST API? || Is JWT better than session? || Is JWT the same as OAuth? ||
    JWT Authentication || JWT authentication: Best practices and when to use it || What Is JWT? How Does It Work? ||
    JWT Token Authentication And Authorizations In .Net Core 8.0 || Is there any JSON Web Token (JWT) example in C# ||
    Implementing JWT authentication in Asp.net WebApi || Implementing JWT Authentication in ASP.NET Core 8 ||
    Jwt .Net 8 , a JWT (JSON Web Token) implementation for .NET core 8 || Create and Sign a JSON Web Token (JWT) with C# and .Net core 8 ||
    JWT Bearer token using ApiKeyScheme || JWT Authorization in Swagger || asp.net core 8 version token based authentication ||
    how to access the api with jwt token .net 8 || NET 8.0 - JWT Authentication Tutorial with Example API ||
    How to implement JWT autentication in ASP Core Net 8 || ‍ Authentication And Authorization In .NET Core Web API
    token authentication
    token authentication explained
    token authentication c#
    token authentication vs jwt
    token authentication postman
    jwt
    jwt token
    jwt authentication
    asp.net core authentication
    asp.net core 8 authentication
    asp.net core jwt
    asp.net core token authentication
    json web token
    json web token authentication
    Thanks for watching. 😊😊 🙏🙏

ความคิดเห็น • 29

  • @aguelejoseph5753
    @aguelejoseph5753 หลายเดือนก่อน +1

    Mid way into video and I can see already that you are a good teacher. Great work bro. Thank you

  • @MarryA-qc4sy
    @MarryA-qc4sy 2 หลายเดือนก่อน +2

    Hello sir, waiting for your next video. Long gap, didn't see any update. Please keep uploading regularly. I like all your video tutorials. Thank you. 😊

  • @ShwetaKadam-gt5cn
    @ShwetaKadam-gt5cn 2 หลายเดือนก่อน +2

    very nice explanation with implementation of JWT Token Authentication.

    • @ManojDeshwal
      @ManojDeshwal  2 หลายเดือนก่อน

      Glad it was helpful!

  • @iwandev7798
    @iwandev7798 หลายเดือนก่อน +2

    thank you sir, i will waiting for next video to add refresh token. Because i want to know, how to implement refresh token if access token expired.

  • @jennasyeda6613
    @jennasyeda6613 3 หลายเดือนก่อน +1

    Superb! very nice way to create JWT. but if u mention the the details about header payload signature in the video then it will greate for the junior developers, this type of question ask in interview, Thank for the video.

  • @broadshare
    @broadshare หลายเดือนก่อน +1

    But why all this when .NET 8 already has auth endpoints to generate that?

  • @vimleshsharma3251
    @vimleshsharma3251 2 หลายเดือนก่อน +1

    very good you have explained in very simple way

  • @lauwwulan861
    @lauwwulan861 4 หลายเดือนก่อน +1

    Thank you for the explanation and code example

  • @SonuKumar-nk4gw
    @SonuKumar-nk4gw 5 หลายเดือนก่อน +5

    how to consume this api in mvc application with token....please

    • @PritamPaul-y1h
      @PritamPaul-y1h 3 หลายเดือนก่อน

      i also wanted to know this..

  • @CarlosEnriqueDuarteOrtiz
    @CarlosEnriqueDuarteOrtiz 2 หลายเดือนก่อน +1

    thank you very much :), greetings from Mexico

    • @ManojDeshwal
      @ManojDeshwal  2 หลายเดือนก่อน

      You're welcome!

  • @sweetysnehith9692
    @sweetysnehith9692 27 วันที่ผ่านมา +1

    Hi
    Can we pass Authorization bearer token in swagger itself is there any reference

    • @ManojDeshwal
      @ManojDeshwal  27 วันที่ผ่านมา

      Yes we can pass. For that we need to enable token option in swagger itself

    • @sweetysnehith9692
      @sweetysnehith9692 27 วันที่ผ่านมา

      @@ManojDeshwal can you please share any reference for it

  • @phanimudapaka306
    @phanimudapaka306 หลายเดือนก่อน +1

    Can you please post the video of refresh Token generation .. Thanks in Advance..

  • @brahmajiraji1123
    @brahmajiraji1123 หลายเดือนก่อน +1

    Nice tutorial

  • @rishumehta745
    @rishumehta745 หลายเดือนก่อน +1

    do you have a video where you connected your database and created model? i missing on that point. new to programming

  • @KrishnaRaj-hw6je
    @KrishnaRaj-hw6je 5 หลายเดือนก่อน +1

    Can you post the Project to create a project management tool for the frontend using react js and backend use web api .net and database use sql server can post for me with in two days

  • @josecortijo9311
    @josecortijo9311 4 หลายเดือนก่อน +1

    how to get the authenticated user

  • @khatariinsaan5284
    @khatariinsaan5284 3 หลายเดือนก่อน +1

    very Helpfull

  • @S-yf5te
    @S-yf5te 3 หลายเดือนก่อน +1

    Who will issue jwt token

  • @govindkumarchoudhary4106
    @govindkumarchoudhary4106 3 หลายเดือนก่อน +1

    nice tutorial

  • @gunasekaranpalanisami6182
    @gunasekaranpalanisami6182 19 วันที่ผ่านมา

    Nice , I need ROLE base bro

  • @sivamariyappan4853
    @sivamariyappan4853 4 หลายเดือนก่อน +1

    could you pls give the source code sirr