Authentication
Ta treść nie jest jeszcze dostępna w Twoim języku.
Get Salt for Password Hashing
Section titled “Get Salt for Password Hashing”Provides a unique salt string used by the client to hash the password before authentication.
GET /api/login/salt/
Response:
| Field | Type | Description |
|---|---|---|
salt | string | Unique salt string for password hashing. |
Example Response:
{ "salt": "sFtqKto6hnaURPGQLJOCT1QMx7myDEGLBsCz3a2L"}User Authentication
Section titled “User Authentication”Allows a user to authenticate and receive an access token.
POST /api/login/
Request Parameters:
| Field | Type | Description |
|---|---|---|
username | string | Username. |
password | string | SHA1 hash of the password in hex format. |
Note: SHA1 password hash is calculated as SHA1(username + password + salt).
Example Request:
{ "username": "admin", "password": "90d54ed4126a0924528810aa5673a6d616d5f274"}Response:
Upon successful authentication, a token and its expiration time are returned.
| Field | Type | Description |
|---|---|---|
authType | string | Authentication type (Bearer). |
token | string | Access token. |
ttlSec | integer | Token time-to-live in seconds. |
{ "authType": "Bearer", "token": "ej5k2pVg4Pd8yBdUqFPq8bdaStpeAZhyelpmkhtOivdK8r7E", "ttlSec": 60}Logout
Section titled “Logout”Ends the current user session and invalidates the token.
POST /api/cmd/logout/
Example Request:
{}Response:
Empty JSON upon successful command execution.
{}