LDAP authentication API allows to check ldap user credentials and change LDAP settings.
URI: https://hub.cfengine.com/ldap/login
Method: POST
Parameters:
Example response:
HTTP 200 Ok
{
"success": true,
"message": "You are successfully authenticated"
}
URI: https://hub.cfengine.com/ldap/settings
Method: GET
Headers:
/var/cfengine/httpd/htdocs/ldap/config/settings.php
Example response:
HTTP 200 Ok
{
"success": true,
"data": {
"domain_controller": "local.loc",
"base_dn": "DC=local,DC=loc",
"login_attribute": "cn",
"port": 365,
"use_ssl": false,
"use_tls": false,
"timeout": 5,
"admin_username": "cn=admin,DC=local,DC=loc",
"admin_password": "Password is set"
}
}
Output:
URI: https://hub.cfengine.com/ldap/settings
Method: PATCH
Note that the PATCH HTTP method only requires partial JSON for an update. Such as {“port”:3269} instead of the entire set of parameters.
Headers:
Authorization: api_token (string)
Set token to access api. To get the token please look at - /var/cfengine/httpd/htdocs/ldap/config/settings.php
Content-Type: application/json (string) Content-Type must be application/json for the API to parse JSON provided.
Parameters:
Example response:
HTTP 200 Ok
{
"success": true,
"message": "Settings successfully saved."
}