LDAP Connector API
On this page
1.18.0
The following APIs are provided to manage LDAPA protocol for reading and authenticating users in a directory server, such as Active Directory. FusionAuth connects to a directory server through an LDAP Connector. Connectors.
Create the LDAP Connector#
Request#
Create an LDAP Connector with either a randomly generated Id or one you provide on the URI.
OpenAPI Spec
OpenAPI Spec
The type in the request JSON is used to determine that you are creating a LDAP Connector.
Path Parameters#
connectorIdThe Id to use for the new Connector. If not specified a secure random UUID will be generated.
Request Body#
connector.authenticationURL The fully qualified LDAP URL to authenticate.
connector.baseStructure The top of the LDAP directory hierarchy. Typically this contains the dc (domain component) element.
connector.connectTimeout The connect timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
connector.data An object that can hold any information about the Connector that should be persisted.
connector.debug Determines if debug should be enabled to create an event log to assist in debugging integration errors.
connector.identifyingAttribute The entry attribute name which is the first component of the distinguished name of entries in the directory.
connector.lambdaConfiguration.reconcileId The Id of an existing Lambda. The lambda is executed after the user authenticates with the connector. This lambda can create a user, registrations, and group memberships in FusionAuth based on attributes returned from the connector.
connector.loginIdAttribute The entity attribute name which stores the identifier that is used for logging the user in.
connector.name The unique LDAP Connector name.
connector.readTimeout The read timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
connector.requestedAttributes The attributes to request for an entry from the DIT (Directory Information Tree).
connector.securityMethod The LDAP security method. Possible values are:
None- Requests will be made without encryption.LDAPS- A secure connection will be made to a secure port over using the LDAPS protocol.StartTLS- An un-secured connection will initially be established, followed by secure connection established using the StartTLS extension.
connector.systemAccountDN The distinguished name of an entry that has read access to the directory.
connector.systemAccountPassword The password of an entry that has read access to the directory.
connector.type This field must be set to LDAP.
{
"connector": {
"authenticationURL": "ldap://localhost:389",
"baseStructure": "dc=mydomain,dc=org",
"connectTimeout": 100,
"data": {
"modifiedBy": "richard"
},
"debug": true,
"identifyingAttribute": "uid",
"lambdaConfiguration": {
"reconcileId": "b3360a2d-e81d-4314-b9f1-244a916ca52f"
},
"loginIdAttribute": "mail",
"name": "My LDAP Connector",
"readTimeout": 100,
"requestedAttributes": [
"mail",
"uid",
"objectClass",
"cn",
"employeeType",
"labeledURI",
"telephoneNumber"
],
"securityMethod": "None",
"systemAccountDN": "uid=admin,ou=system",
"systemAccountPassword": "secret",
"type": "LDAP"
}
}Response#
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present. |
| 401 | FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response usually contains an Errors JSON object with the [Exception] general error code. On MySQL, a data field larger than the database column also returns 500. For more information, see Data Field Sizes. |
Response Body#
connector.authenticationURL The fully qualified LDAP URL to authenticate.
connector.baseStructure The top of the LDAP directory hierarchy. Typically this contains the dc (domain component) element.
connector.connectTimeout The connect timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
connector.data An object that can hold any information about the Connector that should be persisted.
connector.debug Determines if debug should be enabled to create an event log to assist in debugging integration errors.
connector.id The unique Id of the LDAP Connector.
connector.identifyingAttribute The entry attribute name which is the first component of the distinguished name of entries in the directory.
connector.insertInstant The instant when the LDAP Connector was created.
connector.lambdaConfiguration.reconcileId The Id of an existing Lambda. The lambda is executed after the user authenticates with the connector. This lambda can create a user, registrations, and group memberships in FusionAuth based on attributes returned from the connector.
connector.lastUpdateInstant The instant when the LDAP Connector was last updated.
connector.loginIdAttribute The entity attribute name which stores the identifier that is used for logging the user in.
connector.name The unique LDAP Connector name.
connector.readTimeout The read timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
connector.requestedAttributes The attributes to request for an entry from the DIT (Directory Information Tree).
connector.securityMethod The LDAP security method. Possible values are:
None- Requests will be made without encryption.LDAPS- A secure connection will be made to a secure port over using the LDAPS protocol.StartTLS- An un-secured connection will initially be established, followed by secure connection established using the StartTLS extension.
connector.systemAccountDN The distinguished name of an entry that has read access to the directory.
connector.systemAccountPassword The password of an entry that has read access to the directory.
connector.type This field must be set to LDAP.
{
"connector": {
"authenticationURL": "ldap://localhost:389",
"baseStructure": "dc=mydomain,dc=org",
"connectTimeout": 100,
"data": {
"modifiedBy": "richard"
},
"debug": true,
"id": "1c212e59-0d0e-6b1a-ad48-f4f92793be32",
"identifyingAttribute": "uid",
"insertInstant": 1503513015493,
"lambdaConfiguration": {
"reconcileId": "fbd1210-2818-4353-adb2-952613eb5d96"
},
"lastUpdateInstant": 1503513549421,
"loginIdAttribute": "mail",
"name": "My LDAP Connector",
"readTimeout": 100,
"requestedAttributes": [
"mail",
"uid",
"objectClass",
"cn",
"employeeType",
"labeledURI",
"telephoneNumber"
],
"securityMethod": "None",
"systemAccountDN": "uid=admin,ou=system",
"systemAccountPassword": "secret",
"type": "LDAP"
}
}Retrieve the LDAP Connector#
Request#
Retrieve the LDAP Connector by its Id.
OpenAPI Spec
Path Parameters#
connectorIdThe Id of the Connector to retrieve.
Response#
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present. |
| 401 | FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses. |
| 404 | The object you requested doesn't exist. The response is empty. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty. |
Response Body#
connector.authenticationURL The fully qualified LDAP URL to authenticate.
connector.baseStructure The top of the LDAP directory hierarchy. Typically this contains the dc (domain component) element.
connector.connectTimeout The connect timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
connector.data An object that can hold any information about the Connector that should be persisted.
connector.debug Determines if debug should be enabled to create an event log to assist in debugging integration errors.
connector.id The unique Id of the LDAP Connector.
connector.identifyingAttribute The entry attribute name which is the first component of the distinguished name of entries in the directory.
connector.insertInstant The instant when the LDAP Connector was created.
connector.lambdaConfiguration.reconcileId The Id of an existing Lambda. The lambda is executed after the user authenticates with the connector. This lambda can create a user, registrations, and group memberships in FusionAuth based on attributes returned from the connector.
connector.lastUpdateInstant The instant when the LDAP Connector was last updated.
connector.loginIdAttribute The entity attribute name which stores the identifier that is used for logging the user in.
connector.name The unique LDAP Connector name.
connector.readTimeout The read timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
connector.requestedAttributes The attributes to request for an entry from the DIT (Directory Information Tree).
connector.securityMethod The LDAP security method. Possible values are:
None- Requests will be made without encryption.LDAPS- A secure connection will be made to a secure port over using the LDAPS protocol.StartTLS- An un-secured connection will initially be established, followed by secure connection established using the StartTLS extension.
connector.systemAccountDN The distinguished name of an entry that has read access to the directory.
connector.systemAccountPassword The password of an entry that has read access to the directory.
connector.type This field must be set to LDAP.
{
"connector": {
"authenticationURL": "ldap://localhost:389",
"baseStructure": "dc=mydomain,dc=org",
"connectTimeout": 100,
"data": {
"modifiedBy": "richard"
},
"debug": true,
"id": "1c212e59-0d0e-6b1a-ad48-f4f92793be32",
"identifyingAttribute": "uid",
"insertInstant": 1503513015493,
"lambdaConfiguration": {
"reconcileId": "fbd1210-2818-4353-adb2-952613eb5d96"
},
"lastUpdateInstant": 1503513549421,
"loginIdAttribute": "mail",
"name": "My LDAP Connector",
"readTimeout": 100,
"requestedAttributes": [
"mail",
"uid",
"objectClass",
"cn",
"employeeType",
"labeledURI",
"telephoneNumber"
],
"securityMethod": "None",
"systemAccountDN": "uid=admin,ou=system",
"systemAccountPassword": "secret",
"type": "LDAP"
}
}Update the LDAP Connector#
This API is used to update an existing LDAP Connector.
You must specify all of the properties of the LDAP Connector when calling this API with the PUT HTTP method. When used with PUT, this API doesn't merge the existing LDAP Connector and your new data. It replaces the existing LDAP Connector with your new data.
Utilize the PATCH HTTP method to send specific changes to merge into an existing LDAP Connector.
Request#
Send the full LDAP Connector with your changes applied.
OpenAPI Spec
OpenAPI Spec
For backward compatibility, a PATCH request with a Content-Type of application/json accepts the same body as the PUT request. FusionAuth merges the request into the existing object:
- FusionAuth keeps every field that the request leaves out, so send only the fields you want to change.
- FusionAuth merges a map, such as
data, by key. To remove a key, set the key tonull. - FusionAuth appends the values in a request array to the existing array, unless this API documents otherwise. An empty array leaves the existing array unchanged, so you can't remove values from an appending array.
- FusionAuth adds each object in an array of objects as a new element. FusionAuth doesn't match the object to an existing element by Id or by position.
- Don't send a value that an array of Ids already contains, such as a key Id or a Tenant Id. Some of these arrays then return a
500status code. - Don't set an array to
null. Depending on the field, FusionAuth clears the array or returns a500status code.
To remove values from an array, PUT the full object, or set the Content-Type to one of the following media types:
application/json-patch+jsonfor JSON Patch (RFC 6902)application/merge-patch+jsonfor JSON Merge Patch (RFC 7396)
For more information, see The PATCH HTTP Method.
Path Parameters#
connectorIdThe Id of the Connector to update.
Request Body#
connector.authenticationURL The fully qualified LDAP URL to authenticate.
connector.baseStructure The top of the LDAP directory hierarchy. Typically this contains the dc (domain component) element.
connector.connectTimeout The connect timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
connector.data An object that can hold any information about the Connector that should be persisted.
connector.debug Determines if debug should be enabled to create an event log to assist in debugging integration errors.
connector.identifyingAttribute The entry attribute name which is the first component of the distinguished name of entries in the directory.
connector.lambdaConfiguration.reconcileId The Id of an existing Lambda. The lambda is executed after the user authenticates with the connector. This lambda can create a user, registrations, and group memberships in FusionAuth based on attributes returned from the connector.
connector.loginIdAttribute The entity attribute name which stores the identifier that is used for logging the user in.
connector.name The unique LDAP Connector name.
connector.readTimeout The read timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
connector.requestedAttributes The attributes to request for an entry from the DIT (Directory Information Tree).
connector.securityMethod The LDAP security method. Possible values are:
None- Requests will be made without encryption.LDAPS- A secure connection will be made to a secure port over using the LDAPS protocol.StartTLS- An un-secured connection will initially be established, followed by secure connection established using the StartTLS extension.
connector.systemAccountDN The distinguished name of an entry that has read access to the directory.
connector.systemAccountPassword The password of an entry that has read access to the directory.
connector.type This field must be set to LDAP.
{
"connector": {
"authenticationURL": "ldap://localhost:389",
"baseStructure": "dc=mydomain,dc=org",
"connectTimeout": 100,
"data": {
"modifiedBy": "richard"
},
"debug": true,
"identifyingAttribute": "uid",
"lambdaConfiguration": {
"reconcileId": "b3360a2d-e81d-4314-b9f1-244a916ca52f"
},
"loginIdAttribute": "mail",
"name": "My LDAP Connector",
"readTimeout": 100,
"requestedAttributes": [
"mail",
"uid",
"objectClass",
"cn",
"employeeType",
"labeledURI",
"telephoneNumber"
],
"securityMethod": "None",
"systemAccountDN": "uid=admin,ou=system",
"systemAccountPassword": "secret",
"type": "LDAP"
}
}Response#
The response for this API contains the LDAP Connector.
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present. |
| 401 | FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses. |
| 404 | The object you're updating doesn't exist. The response is empty. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response usually contains an Errors JSON object with the [Exception] general error code. On MySQL, a data field larger than the database column also returns 500. For more information, see Data Field Sizes. |
Response Body#
connector.authenticationURL The fully qualified LDAP URL to authenticate.
connector.baseStructure The top of the LDAP directory hierarchy. Typically this contains the dc (domain component) element.
connector.connectTimeout The connect timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
connector.data An object that can hold any information about the Connector that should be persisted.
connector.debug Determines if debug should be enabled to create an event log to assist in debugging integration errors.
connector.id The unique Id of the LDAP Connector.
connector.identifyingAttribute The entry attribute name which is the first component of the distinguished name of entries in the directory.
connector.insertInstant The instant when the LDAP Connector was created.
connector.lambdaConfiguration.reconcileId The Id of an existing Lambda. The lambda is executed after the user authenticates with the connector. This lambda can create a user, registrations, and group memberships in FusionAuth based on attributes returned from the connector.
connector.lastUpdateInstant The instant when the LDAP Connector was last updated.
connector.loginIdAttribute The entity attribute name which stores the identifier that is used for logging the user in.
connector.name The unique LDAP Connector name.
connector.readTimeout The read timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
connector.requestedAttributes The attributes to request for an entry from the DIT (Directory Information Tree).
connector.securityMethod The LDAP security method. Possible values are:
None- Requests will be made without encryption.LDAPS- A secure connection will be made to a secure port over using the LDAPS protocol.StartTLS- An un-secured connection will initially be established, followed by secure connection established using the StartTLS extension.
connector.systemAccountDN The distinguished name of an entry that has read access to the directory.
connector.systemAccountPassword The password of an entry that has read access to the directory.
connector.type This field must be set to LDAP.
{
"connector": {
"authenticationURL": "ldap://localhost:389",
"baseStructure": "dc=mydomain,dc=org",
"connectTimeout": 100,
"data": {
"modifiedBy": "richard"
},
"debug": true,
"id": "1c212e59-0d0e-6b1a-ad48-f4f92793be32",
"identifyingAttribute": "uid",
"insertInstant": 1503513015493,
"lambdaConfiguration": {
"reconcileId": "fbd1210-2818-4353-adb2-952613eb5d96"
},
"lastUpdateInstant": 1503513549421,
"loginIdAttribute": "mail",
"name": "My LDAP Connector",
"readTimeout": 100,
"requestedAttributes": [
"mail",
"uid",
"objectClass",
"cn",
"employeeType",
"labeledURI",
"telephoneNumber"
],
"securityMethod": "None",
"systemAccountDN": "uid=admin,ou=system",
"systemAccountPassword": "secret",
"type": "LDAP"
}
}Delete the LDAP Connector#
Request#
Delete the LDAP Connector by its Id.
OpenAPI Spec
Path Parameters#
connectorIdThe Id of the Connector to delete.
Response#
This API does not return a JSON response body.
| Code | Description |
|---|---|
| 200 | The request succeeded. |
| 400 | The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present. |
| 401 | FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses. |
| 404 | The object you requested doesn't exist. The response is empty. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty. |
Related
Learn about the APIs for creating, retrieving, and updating Generic Connectors.
Learn about the APIs for creating, retrieving, updating and deleting identity providers.
API documentation for the FusionAuth Create a Lambda API.
API documentation for the FusionAuth Delete a Lambda API.