token role

Prevent duplicate submission form

Identity verification

Use the Token-based authentication methods, logon recorded in the server does not need to store the user. Probably the process is this:

1. The client uses the user login name with the password request.

2. Send a request to the backend via ajax.

3. The server receives the request, to verify the user name and password.

4. After successful authentication, the server will issue a Token, then the Token is sent to the client

The client side after it receives Token can be stored, such as in a Cookie, or in the Local Storage

6. Every time a client requests a resource to the server needs with the server issued Toke (whether you write yourself) it must send a request to the backend via ajax, then

7. The data server receives the request, then the client request to verify with the inside of the Token, if authentication is successful, it is returned to the client's request

 

Reprint:

https://www.cnblogs.com/manban/p/10874837.html

Guess you like

Origin www.cnblogs.com/shix0909/p/11824197.html