当前位置:网站首页>This article will help you understand the common concepts, advantages and disadvantages of JWT

This article will help you understand the common concepts, advantages and disadvantages of JWT

2022-06-25 16:04:00 JavaGuide

This article originated in JWT Analysis of advantages and disadvantages of identity authentication .

stay JWT Detailed explanation of basic concepts In this article , I introduced :

  • What is? JWT?
  • JWT What are the components of ?
  • How to base on JWT Authentication ?
  • JWT How to prevent Token Be tampered with ?
  • How to strengthen JWT The security of ?

This article , Let's discuss JWT Advantages and disadvantages of identity authentication and solutions to common problems .

JWT The advantages of

Compared with Session In the way of Authentication , Use JWT Identity authentication mainly includes the following 4 Advantages .

No state

JWT It contains all the information needed for authentication , therefore , Our servers don't need storage Session Information . This obviously increases the availability and scalability of the system , The pressure on the service side is greatly reduced .

however , Because JWT stateless , It also leads to its biggest drawback : Out of control !

Such as , We want to JWT Discard one within the validity period JWT Or change its permissions , It will not take effect immediately , It is usually necessary to wait until the expiry date . Again for instance , When the user Logout Words ,JWT It also works . Unless , We add additional processing logic at the back end, such as those that will fail JWT Store it , The back end first verifies JWT Whether to proceed again effectively

原网站

版权声明
本文为[JavaGuide]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251533542513.html