This thing is not very understand, but looked up a bit of information, probably know what, specifically how to nest to specific needs to implement the function inside, this span is still a bit large,
First the blog address to the collection.
Here is the Java version of the example
Reference to Jane's book
JS Example
GitHub Project Code
RFC protocol English Documentation
Single Sign-on solution
In general, large applications will separate the logic of authorization from the logic of user information into one application, called the User Center.
The User Center does not process business logic, but only handles the management of user information and authorizes third-party applications. When a third-party application needs to log in, the user's login request is forwarded to the User Center for processing, the user processes the return voucher, the third-party application validates the credentials, and the user is logged on.
Jc_huang
Links: https://www.jianshu.com/p/613e44d4a464
Source: Pinterest
The copyright of the book is owned by the author, and any form of reprint should be contacted by the author for authorization and attribution. The certification process for JWT
- User login system;
- Server-side authentication, which encrypts the authentication information through a specified algorithm (for example, HS256), such as encrypting the user name and the user-owned role, encrypting the private key to the client side, and sending the encrypted result to the clients, the encrypted string format is three "." Delimited string tokens, corresponding to the header , load and signature, both the head and the load can be decoded by Base64, the signature part cannot be;
- The client gets the Token returned, which is stored in the local storage or the native database;
- The next time the client initiates the request, the Token is appended to the header;
- The server obtains tokens in the header, uses the same algorithm to authenticate the user name and the owning role in token, and if the validation result is the same, the request is normal and not tampered with. This process may not involve querying Redis or other storage at all;
Jsonwebtoken Favorite Blog Address