IPWorks Auth 2020 Python Edition

Questions / Feedback?

LDAP Class

Properties   Methods   Events   Configuration Settings   Errors  

The LDAP Class is used to search, manage, and maintain Internet Directory (LDAP) servers.

Syntax

class ipworksauth.LDAP

Remarks

The LDAP Class supports both plaintext and SSL/TLS connections. When connecting over SSL/TLS the on_ssl_server_authentication event allows you to check the server identity and other security attributes. The on_ssl_status event provides information about the SSL handshake. 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 server_name, 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 on_result event. The only exceptions are search requests which result in one or more on_search_result events, followed by a final on_search_complete 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 search_scope, search_time_limit, search_size_limit, search_return_values, and search_deref_aliases.

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.

accept_dataEnables or disables data reception from the server.
attr_countThe number of records in the Attr arrays.
attr_typeAttribute type for the current entry.
attr_mod_opAn operation to apply on attributes during an LDAP modify operation.
attr_valueAttribute value for the current entry.
auth_mechanismThe authentication mechanism to be used when connecting to the LDAP server.
connectedShows whether the class is connected.
delete_old_rdnControls whether the old RDN (Relative Distinguished Name) should be deleted.
dnThe Distinguished Name used as the base for LDAP operations.
firewall_auto_detectThis property tells the class whether or not to automatically detect and use firewall system settings, if available.
firewall_typeThis property determines the type of firewall to connect through.
firewall_hostThis property contains the name or IP address of firewall (optional).
firewall_passwordThis property contains a password if authentication is to be used when connecting through the firewall.
firewall_portThis property contains the TCP port for the firewall Host .
firewall_userThis property contains a user name if authentication is to be used connecting through a firewall.
idleThe current status of the class.
ldap_versionThe version of LDAP used.
local_hostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.
message_idThe message identifier for the next LDAP request.
page_sizeThe maximum number of results per page for the Search method.
passwordThe password used to authenticate to the LDAP server.
reference_countThe number of records in the Reference arrays.
reference_urlThe url of the LDAP reference.
result_codeThe result code returned in the last server response.
result_descriptionThe descriptive text returned in the last server response (if any).
result_dnThe Distinguished Name returned in the last server response (if any).
search_deref_aliasesControls alias dereferencing during searching.
search_return_valuesControls whether the search operation returns values of attributes, or only types.
search_scopeControls the scope of LDAP search operations.
search_size_limitMaximum number of entries that can be returned by the next search operation.
search_time_limitA time limit for the next search operation (in seconds).
server_nameThe name or address of the LDAP server.
server_portThe server port for the LDAP connection (default is 389).
sort_attributesA string of attribute names to sort on with optional relative matching rules.
ssl_accept_server_cert_encodedThe certificate (PEM/base64 encoded).
ssl_cert_encodedThe certificate (PEM/base64 encoded).
ssl_cert_storeThe name of the certificate store for the client certificate.
ssl_cert_store_passwordIf 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.
ssl_cert_store_typeThe type of certificate store for this certificate.
ssl_cert_subjectThe subject of the certificate used for client authentication.
ssl_enabledWhether TLS/SSL is enabled.
ssl_server_cert_encodedThe certificate (PEM/base64 encoded).
ssl_start_modeDetermines how the class starts the SSL negotiation.
timeoutA timeout for the class.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

abandonAsks the server to abandon a request.
addAdds an entry specified by DN to the directory server using the type and value attributes defined in the Attributes properties.
attrReturns the value of the specified LDAP attribute.
bindConnects and binds to the directory server.
change_passwordChanges the password for the specified user.
compareCompares attributes and values with those of the entry specified by DN .
configSets or retrieves a configuration setting.
deleteDeletes an entry specified by DN from the directory server.
do_eventsProcesses events from the internal message queue.
extended_requestPerforms an LDAP V3 Extended Operation.
interruptInterrupt the current method.
list_computersLists all computers in the directory.
list_group_membersList all members of a group.
list_groupsList all groups in the directory.
list_user_groupsLists all groups a user is a part of.
modifyPerforms an LDAP 'modify' operation on the entry specified by DN .
modify_rdnPerforms an LDAP 'modify RDN' operation an entry specified by DN .
move_to_dnPerforms an LDAP 'modify' operation on the entry specified by DN by changing its superior.
resetReset the class.
searchSearches the directory server using the base object specified in DN and the search filter SearchFilter .
unbindUnbinds 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.

on_computer_listFired for each computer entry returned.
on_connectedFired immediately after a connection completes (or fails).
on_connection_statusFired to indicate changes in connection state.
on_disconnectedFired when a connection is closed.
on_errorInformation about errors during data delivery.
on_extended_responseFired for LDAP V3 Extended Responses.
on_group_listFired for each group entry returned.
on_pi_trailProvides detailed information about the interaction with the server.
on_resultFired for every server response, except search responses.
on_search_completeFired upon completion of a search operation.
on_search_pageFired for every page returned from a search operation.
on_search_resultFired for every entry returned from a search operation.
on_search_result_referenceFired for every result reference returned from a search operation.
on_ssl_server_authenticationFired after the server presents its certificate to the client.
on_ssl_statusShows the progress of the secure connection.
on_user_listFired once for each user entry returned.

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

DomainControllerReturns the name of the domain controller.
FriendlyGUIDWhether to return GUID attribute values in a human readable format.
FriendlySIDWhether to return SID attribute values in a human readable format.
RequestControlsControls to include in the request.
ResponseControlsControls present in the response.
SingleResultModeDetermines how ResultDN behaves.
UseDefaultDCWhether to connect to the default Domain Controller when calling Bind.
ConnectionTimeoutSets a separate timeout value for establishing a connection.
FirewallAutoDetectTells the class whether or not to automatically detect and use firewall system settings, if available.
FirewallHostName or IP address of firewall (optional).
FirewallPasswordPassword to be used if authentication is to be used when connecting through the firewall.
FirewallPortThe TCP port for the FirewallHost;.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
KeepAliveIntervalThe retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received.
KeepAliveTimeThe inactivity time in milliseconds before a TCP keep-alive packet is sent.
LingerWhen set to True, connections are terminated gracefully.
LingerTimeTime in seconds to have the connection linger.
LocalHostThe name of the local host through which connections are initiated or accepted.
LocalPortThe port in the local host where the class binds.
MaxLineLengthThe maximum amount of data to accumulate when no EOL is found.
MaxTransferRateThe transfer rate limit in bytes per second.
ProxyExceptionsListA semicolon separated list of hosts and IPs to bypass when using a proxy.
TCPKeepAliveDetermines whether or not the keep alive socket option is enabled.
TcpNoDelayWhether or not to delay when sending packets.
UseIPv6Whether to use IPv6.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Auth 2020 Python Edition - Version 20.0 [Build 8155]