Skip to content

Authentication

Provides a unique salt string used by the client to hash the password before authentication.

GET /api/login/salt/

Response:

FieldTypeDescription
saltstringUnique salt string for password hashing.

Example Response:

{
"salt": "sFtqKto6hnaURPGQLJOCT1QMx7myDEGLBsCz3a2L"
}

Allows a user to authenticate and receive an access token.

POST /api/login/

Request Parameters:

FieldTypeDescription
usernamestringUsername.
passwordstringSHA1 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.

FieldTypeDescription
authTypestringAuthentication type (Bearer).
tokenstringAccess token.
ttlSecintegerToken time-to-live in seconds.
{
"authType": "Bearer",
"token": "ej5k2pVg4Pd8yBdUqFPq8bdaStpeAZhyelpmkhtOivdK8r7E",
"ttlSec": 60
}

Ends the current user session and invalidates the token.

POST /api/cmd/logout/

Example Request:

{}

Response:

Empty JSON upon successful command execution.

{}