LDAP Class
Properties Methods Events Configuration Settings Errors
The LDAP Component is used to search, manage, and maintain Internet Directory (LDAP) servers.
Syntax
ipworks.ldap()
Remarks
The LDAP Class supports both plaintext and SSL/TLS connections. When connecting over SSL/TLS the SSLServerAuthentication event allows you to check the server identity and other security attributes. The SSLStatus event provides information about the SSL handhsake. Additional SSL related settings are also supported via the Config method.
The LDAP Class implements a standard LDAP client as specified in RFC 1777, 2251, and other LDAP RFCs. Support for both LDAP v2 and v3 is provided.
The first step in using the class is specifying the ServerName, a DN (Distinguished Name) to bind as, and optionally a Password. Then you can call one or more of the class methods to act upon the server. Server responses are normally received through the Result event. The only exceptions are search requests which result in one or more SearchResult events, followed by a final SearchComplete event.
Attributes are set and returned through the Attributes properties. Other command arguments are specified through other properties. These are specified in detail in each method.
Search filters are to be specified as string arguments to the Search method. The format must be a standard LDAP search string as specified in RFC 1558. Other search attributes are set in properties such as SearchScope, SearchTimeLimit, SearchSizeLimit, SearchReturnValues, and SearchDerefAliases.
The class operates synchronously by default (waits for a response before returning control to the caller), however, the class may also operate asynchronously (return control immediately), by setting Timeout to 0. Please refer to the Timeout property for more information.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
AcceptData | Enables or disables data reception from the server. |
AttrCount | The number of records in the Attr arrays. |
AttrType | Attribute type for the current entry. |
AttrModOp | An operation to apply on attributes during an LDAP modify operation. |
AttrValue | Attribute value for the current entry. |
AuthMechanism | The authentication mechanism to be used when connecting to the LDAP server. |
Connected | Shows whether the component is connected. |
DeleteOldRDN | Controls whether the old RDN (Relative Distinguished Name) should be deleted. |
DN | The Distinguished Name used as the base for LDAP operations. |
FirewallAutoDetect | This property tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallType | This property determines the type of firewall to connect through. |
FirewallHost | This property contains the name or IP address of firewall (optional). |
FirewallPassword | This property contains a password if authentication is to be used when connecting through the firewall. |
FirewallPort | This property contains the TCP port for the firewall Host . |
FirewallUser | This property contains a user name if authentication is to be used connecting through a firewall. |
Idle | The current status of the component. |
LDAPVersion | The version of LDAP used. |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
MessageId | The message identifier for the next LDAP request. |
PageSize | The maximum number of results per page for the Search method. |
Password | The password used to authenticate to the LDAP server. |
ReferenceCount | The number of records in the Reference arrays. |
ReferenceURL | The url of the LDAP reference. |
ResultCode | The result code returned in the last server response. |
ResultDescription | The descriptive text returned in the last server response (if any). |
ResultDN | The Distinguished Name returned in the last server response (if any). |
SearchDerefAliases | Controls alias dereferencing during searching. |
SearchReturnValues | Controls whether the search operation returns values of attributes, or only types. |
SearchScope | Controls the scope of LDAP search operations. |
SearchSizeLimit | Maximum number of entries that can be returned by the next search operation. |
SearchTimeLimit | A time limit for the next search operation (in seconds). |
ServerName | The name or address of the LDAP server. |
ServerPort | The server port for the LDAP connection (default is 389). |
SortAttributes | A string of attribute names to sort on with optional relative matching rules. |
SSLAcceptServerCertEncoded | The certificate (PEM/base64 encoded). |
SSLCertEncoded | The certificate (PEM/base64 encoded). |
SSLCertStore | The name of the certificate store for the client certificate. |
SSLCertStorePassword | If the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store. |
SSLCertStoreType | The type of certificate store for this certificate. |
SSLCertSubject | The subject of the certificate used for client authentication. |
SSLEnabled | Whether TLS/SSL is enabled. |
SSLServerCertEncoded | The certificate (PEM/base64 encoded). |
SSLStartMode | Determines how the component starts the SSL negotiation. |
Timeout | A timeout for the component. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Abandon | Asks the server to abandon a request. |
Add | Adds an entry specified by DN to the directory server using the type and value attributes defined in the Attributes properties. |
Attr | Returns the value of the specified LDAP attribute. |
Bind | Connects and binds to the directory server. |
Compare | Compares attributes and values with those of the entry specified by DN . |
Config | Sets or retrieves a configuration setting . |
Delete | Deletes an entry specified by DN from the directory server. |
DoEvents | Processes events from the internal message queue. |
ExtendedRequest | Performs an LDAP V3 Extended Operation. |
Interrupt | Interrupt the current method. |
Modify | Performs an LDAP 'modify' operation on the entry specified by DN . |
ModifyRDN | Performs an LDAP 'modify RDN' operation an entry specified by DN . |
MoveToDN | Performs an LDAP 'modify' operation on the entry specified by DN by changing its superior. |
Reset | Reset the component. |
Search | Searches the directory server using the base object specified in DN and the search filter SearchFilter . |
Unbind | Unbinds from the directory server. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
Connected | Fired immediately after a connection completes (or fails). |
ConnectionStatus | Fired to indicate changes in connection state. |
Disconnected | Fired when a connection is closed. |
Error | Information about errors during data delivery. |
ExtendedResponse | Fired for LDAP V3 Extended Responses. |
PITrail | Provides detailed information about the interaction with the server. |
Result | Fired for every server response, except search responses. |
SearchComplete | Fired upon completion of a search operation. |
SearchPage | Fired for every page returned from a search operation. |
SearchResult | Fired for every entry returned from a search operation. |
SearchResultReference | Fired for every result reference returned from a search operation. |
SSLServerAuthentication | Fired after the server presents its certificate to the client. |
SSLStatus | Shows the progress of the secure connection. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
FriendlyGUID | Whether to return GUID attribute values in a human readable format. |
FriendlySID | Whether to return SID attribute values in a human readable format. |
RequestControls | Controls to include in the request. |
ResponseControls | Controls present in the response. |
SingleResultMode | Determines how ResultDN behaves. |
UseDefaultDC | Whether to connect to the default Domain Controller when calling Bind. |
DomainController | Returns the name of the domain controller. |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallHost | Name or IP address of firewall (optional). |
FirewallPassword | Password to be used if authentication is to be used when connecting through the firewall. |
FirewallPort | The TCP port for the FirewallHost;. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
Linger | When set to True, connections are terminated gracefully. |
LingerTime | Time in seconds to have the connection linger. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The port in the local host where the component binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
ProxyExceptionsList | A semicolon separated list of hosts and IPs to bypass when using a proxy. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
UseIPv6 | Whether to use IPv6. |
TcpNoDelay | Whether or not to delay when sending packets. |
LogSSLPackets | Controls whether SSL packets are logged when using the internal security API. |
ReuseSSLSession | Determines if the SSL session is reused. |
SSLCipherStrength | The minimum cipher strength used for bulk encryption. |
SSLEnabledProtocols | Used to enable/disable the supported security protocols. |
SSLIncludeCertChain | Whether the entire certificate chain is included in the SSLServerAuthentication event. |
SSLProvider | The name of the security provider to use. |
SSLSecurityFlags | Flags that control certificate verification. |
SSLCACerts | A newline separated list of CA certificate to use during SSL client authentication. |
SSLEnabledCipherSuites | The cipher suite to be used in an SSL negotiation. |
TLS12SignatureAlgorithms | Defines the allowed TLS 1.2 signature algorithms when UseInternalSecurityAPI is True. |
TLS12SupportedGroups | The supported groups for ECC. |
TLS13KeyShareGroups | The groups for which to pregenerate key shares. |
TLS13SupportedGroups | The supported groups for (EC)DHE key exchange. |
TLS13SignatureAlgorithms | The allowed certificate signature algorithms. |
OpenSSLCADir | The path to a directory containing CA certificates. |
OpenSSLCAFile | Name of the file containing the list of CA's trusted by your application. |
OpenSSLCipherList | A string that controls the ciphers to be used by SSL. |
OpenSSLPrngSeedData | The data to seed the pseudo random number generator (PRNG). |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
SelectWaitMillis | The length of time in milliseconds the component will wait when DoEvents is called if there are no events to process. |
CodePage | The system code page used for Unicode to Multibyte translations. |
UseInternalSecurityAPI | Tells the component whether or not to use the system security libraries or an internal implementation. |