Quickupdate

  • Home
  • Top Trending
    • Top Android Apps
    • Top Ios Apps
  • Featured
  • About Us
  • Contact us
  • Privacy Policy and Disclaimer

Saturday, 26 June 2021

What is JWT? Json Web Token

 Developers     June 26, 2021     Javascript     No comments   

Ref: https://youtu.be/7Q17ubqLfaM

  1. What is JWT
  2. Why should you use JWT?
  3. How JWT wORKS?


Authentication: You take the username & password from the user and authenticate that particular user on your website.

Authorization: Authorization means making sure that the user sents a req to the server is the same user that actually logged in at authentication of the process.

We normally do this using the session.




                                                        How session work images above

Session gets stored in the server memory. but in JWT all the users' info present in that token only has been encoded with a secret key. JWT is not stored on a server-side.

Why JWT Over Session?

Example 1: 

let take an example of an HDFC Bank. you logged in to your net banking on the HDFC portal. now you want to pay your electricity bill for that HDFC redirects you to the different websites of HDFC that may be hosted on different servers.

so here is the key. if you use a session you are only logged in on that particular server, not on a bill pay website. so the user has to log in again on the bill pay website. that's the drawback of a session.

But, if you use JWT here, WE Store JWT token (user information) on the client side.
so we can share that JWT token to the bill pay website so the user doesn't have to go through the login process again because we are sharing the Jwt token.





Example2:

Let's say the bank s very large & they have a lot of users. so for load balancing, they may use 2 servers or more. so if there SERVER A gets too busy user may be moved to SERVER B. 

IN this case, JWT is very important. so the users don't have to login again if the server change due to load.

  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Popular Posts

  • How to upload the existing folder on GitHub Or GitLab?
    These are the steps to upload the existing folder on GitHub Or GitLab. Whenever you want to push your existing folder to git or GitHub you m...

Categories

  • FAANG (2)
  • Javascript (6)
  • Node (1)
  • Project Management (1)
  • React (9)
  • SQL (1)
  • Testing (1)

Blog Archive

  • January 2023 (1)
  • January 2022 (1)
  • November 2021 (3)
  • October 2021 (3)
  • August 2021 (1)
  • July 2021 (7)
  • June 2021 (12)
  • February 2021 (1)
  • January 2021 (1)
  • January 2020 (3)
  • August 2019 (3)