Test if Rocket.Chat can connect to the specified LDAP server using the port and host provided in the Rocket.Chat settings. Make sure LDAP is enabled before using this endpoint.
Permission required: test-admin-options.
Changelog
| Version | Description |
|---|---|
| 9.0.0 | Moved to premium plans. |
| 9.0.0 | Added the LDAP_Bind_failed and LDAP_Connection_failed_reason errors. Removed the Connection_failed error. |
The authenticated user token.
The authenticated user ID.
OK
{
"message": "LDAP_Connection_successful",
"success": true
}Bad Request
LDAP bind failed
Rocket.Chat reached the LDAP server, but the server rejected the bind with the configured LDAP_Authentication_UserDN and LDAP_Authentication_Password. details.error contains the LDAP server's error, for example Invalid Credentials.
{
"success": false,
"error": "LDAP_Bind_failed",
"details": {
"error": "Invalid Credentials"
}
}Can't connect to the LDAP server
Rocket.Chat couldn't reach the LDAP server at the configured LDAP_Host and LDAP_Port. details.reason contains the connection error, for example Timeout, connectRefused, or getaddrinfo ENOTFOUND.
{
"success": false,
"error": "LDAP_Connection_failed_reason",
"errorType": "error-ldap-connection-failed",
"details": {
"reason": "Timeout"
}
}Premium license required
The workspace doesn't have a premium license with the ldap-enterprise module.
{
"success": false,
"error": "This is an enterprise feature [error-action-not-allowed]",
"errorType": "error-action-not-allowed"
}LDAP is disabled
LDAP is not enabled in the workspace (LDAP_Enable is off).
{
"success": false,
"error": "LDAP_disabled"
}The LDAP server's error. Returned with LDAP_Bind_failed.
The connection error. Returned with LDAP_Connection_failed_reason.
Unauthorized
{
"success": false,
"error": "You must be logged in to do this."
}Forbidden
Missing permission
The user doesn't have the test-admin-options permission.
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}