2. Authentication management category
2. Authentication management category
2.1 WEB Login Control
2.1.1 Login /auth/login
Note: Login is a whitelisting function that allows access without authentication information.
Note: No token is required to access this interface
Note: To prevent hacker login DDOS attack, processing request random delay 0-2s
Client→Server Request
KEY | VAL | Default | Remark |
---|---|---|---|
username | string | – | Account number Format: 4-32 characters |
password | string | – | Password (MD5 value) Format: 4-32 characters |
Server→Client Response
DATA_SUBKEY | VAL | Default | Remark | Renew |
---|---|---|---|---|
level | string | – | Account Level Information | 230424 |
token | string | – | Current account token, valid for 600 seconds | 231201 |
Request Example
POST /controller/auth/login
Host:172.16.6.79
Raw:{"username":"admin","password":"21232f297a57a5a743894a0e4a801fc3"}
Response Example
{ "uri": "auth/login", "msg": "", "code": 200, "data": { "level": "admin", "token": "80c3d57885ea8baeaaeae0756d0d2e8b" } }
2.1.2 Logging out /auth/logout
Client→Server Request
Server→Client Response
Request Example
POST /controller/auth/logout
Host:172.16.6.79
Raw:{"token":"a05e9cf86f51f2346ea42ba669c2bfc8"}
Response Example
{
"uri": "auth/logout",
"msg": "",
"code": 200,
"data": []
}
2.1.3 Log in to /auth/check_auth
Note: Check the permissions, the interface REST API is automatically called, no need to call the
Client→Server Request
KEY | VAL | Default | Remark | Renew |
---|---|---|---|---|
ip | string | – | current IP address | 230415 |
token | string | – | Current account token, valid for 600 seconds | 231201 |
Server→Client Response
Request Example
Post:/controller
Host:172.16.6.79
Raw:{"ip":"172.16.6.24","token":"19e205016e28bd8900b4be58878be63a"}
Response Example
{
"uri": "auth/check_auth",
"msg": "",
"code": 200,
"data": []
}