Authentication
Ta treść nie jest jeszcze dostępna w Twoim języku.
Get the authorization data
Section titled “Get the authorization data”GET /api/authorization/get/
Response Fields:
| Field | Type | Description |
|---|---|---|
isWireguardAdminAccess | boolean | Administrator access is granted automatically for the VPN server, according to settings. |
isWireguardPowerUserAccess | boolean | Power User access is granted automatically for the VPN server, according to settings. |
leftButtonAuthorizedSessionMs | integer / null | Time in milliseconds until temporary Power User access from the device button expires, or null if the access is of another type. |
leftLoggedInSessionMs | integer / null | Time in milliseconds until the logged-in session expires, or null if the access is of another type. |
sinceAuthorizationCodeSetMs | integer / null | Time in milliseconds from the moment the remote authorization code was set, or null if more than 2 minutes have passed. |
sinceButtonPressedMs | integer / null | Time in milliseconds from the moment the device button was pressed, or null if more than 1 hour has passed. |
Example Response:
{ "isWireguardAdminAccess": true, "isWireguardPowerUserAccess": false, "leftButtonAuthorizedSessionMs": null, "leftLoggedInSessionMs": null, "sinceAuthorizationCodeSetMs": 109700, "sinceButtonPressedMs": 5100}Set the temporary authorization code
Section titled “Set the temporary authorization code”Allows the VPN server to show the temporary 8-digit code on the device display.
The code is then kept displayed for 2 minutes.
POST /api/authorization/code/set/
Request Parameters:
| Field | Type | Description |
|---|---|---|
authorizationCode | integer / null | Code to authorize for the server the user’s physical access to the device, or null to remove the code. |
Example Request:
{ "authorizationCode": 12345678}Response:
Empty JSON upon successful command execution.
{}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 Fields:
| 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. Use admin. |
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 Fields:
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.
{}