The POST /api/ni/auth/token
API endpoint can generate an authentication token for a local account. However, a 401 Unauthorized
response may occur if the request payload is not formatted correctly for a local account.
For example, the following request may result in a 401 Unauthorized
error:
Request:
Response:
This occurs because the request includes a domain
field specifying an LDAP domain, which is not applicable for local accounts.
The POST /api/ni/auth/token
API endpoint supports generating an authentication token for a local account. It is important to note that the "domain" field is mandatory, and for local accounts, "domain_type": "LOCAL"
(in uppercase) must be specified.
Here is an example request for a local account:
Request:
Response:
This ensures that authentication requests for local accounts are processed successfully.