login
The login command authenticates a user with the DisplayNet API.
| Command Type | DisplayNet |
| Minimum Version | 2.x.x |
Usage
login <username> <password>
Arguments
| Argument | Required | Description |
|---|---|---|
username | Yes | The username to log in with. Case-insensitive. |
password | Yes | The password for the user. |
Optional login
The login command is not needed to use the API if authentication is not required. Users may still authenticate in that case, for example to change server settings.
First login creates DNAdmin
On first login, if the DNAdmin account does not yet exist, it is created automatically with the credentials provided.
Examples
Authenticate as the admin userlogin dnadmin password
Return value
The reply is a DN_AUTHENTICATION message. auth_details.IsAuthenticated carries the outcome, and a successful login includes a LoginToken for use with logintoken. A failed login is followed by a second reply, an ERROR with reason AUTH API ERROR.
- Success
- Failure
login dnadmin password{
"status": "DN_AUTHENTICATION",
"request_id": null,
"result": null,
"error": null,
"auth_details": {
"IsAuthenticated": true,
"UserName": "DNAdmin",
"UserFullName": "DNAdmin",
"Role": "Admin",
"ClientAddress": "127.0.0.1:51684",
"AuthState": "COMPLETE",
"AuthenticationDateTime": "2026-07-31T22:55:00.9897486Z",
"ConnectionType": "Socket",
"LoginToken": "9919abb5-24d0-4c56-bbf1-3df91998247c"
}
}
login nosuchuser password{
"status": "DN_AUTHENTICATION",
"request_id": null,
"result": null,
"error": null,
"auth_details": {
"IsAuthenticated": false,
"UserName": "nosuchuser",
"UserFullName": "",
"Role": "",
"ClientAddress": "127.0.0.1:51684",
"AuthState": "RETRY",
"AuthenticationDateTime": "2026-07-31T22:52:27.7409563Z",
"ConnectionType": "Socket",
"LoginToken": ""
}
}
Followed by{
"status": "ERROR",
"request_id": null,
"result": null,
"error": {
"message": "Authentication failed",
"reason": "AUTH API ERROR"
}
}
REST API
| Endpoint type | DisplayNet API command |
|---|---|
| Address | POST /api/displaynet/login. This one has its own endpoint and cannot be named in a request body. |
| Role | None. This one is reachable without a token, whether or not the server requires authentication. |
| Operation | Parameters |
|---|---|
login | user password |
See also
logintoken: re-authenticate with a saved tokenlogout: end the authenticated sessionuser: manage user accounts