archive-org.com » ORG » P » PYTHON-LDAP.ORG

Total: 40

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • python-ldap: LDAP client API for Python
    directory servers from Python programs For LDAP operations the module wraps OpenLDAP s client library libldap for that purpose Additionally the package contains modules for other LDAP related stuff LDIF LDAP URLs LDAPv3 subschema Get it Download information available for several platforms Mailing list Discussion about the use and future of Python LDAP occurs in the python ldap python org mailing list You can subscribe or unsubscribe to this list

    Original URL path: https://www.python-ldap.org/ (2016-04-29)
    Open archived version from archive


  • python-ldap: Downloads
    note that binary packages are most times not up to date If you experience troubles with a binary package it would be nice if you try to build a recent version of python ldap before submitting a bug report to make sure you did not hit a problem already fixed in recent releases openSUSE Linux ships with python ldap and there s an additional download repository which contains builds of

    Original URL path: https://www.python-ldap.org/download.html (2016-04-29)
    Open archived version from archive

  • python-ldap: Documentation
    Python LDAP Applications Part 1 Installing and Configuring the Python LDAP Library and Binding to an LDAP Directory This also covers SASL Python LDAP Applications Part 2 LDAP Operations Python LDAP Applications Part 3 More LDAP Operations and the LDAP URL Library Python LDAP Applications Part 4 LDAP Schema Gee someone waded through the yet undocumented mysteries of module ldap schema LDAP Programming in Python Another article for getting started

    Original URL path: https://www.python-ldap.org/docs.html (2016-04-29)
    Open archived version from archive

  • python-ldap: FAQ
    off l ldap initialize ldap foobar l set option ldap OPT REFERRALS 0 Q Why am I seeing ldap SUCCESS traceback as output A Most likely you are using one of the non synchronous calls and probably mean to be using a synchronous call see detailed explanation in the docs Q Can I use LDAPv2 via python ldap A Yes by explicitly setting the class attribute protocol version You should not do that nowadays since LDAPv2 is considered historic since many years Installing Q Does it work with Windows 32 A You can find links to pre compiled packages for Win32 on the download page Q Can python ldap be built against OpenLDAP 2 3 libs or older A No for recent python ldap 2 4 x the OpenLDAP 2 4 client libs or newer are required Patched builds of python ldap linked to older libs are not supported by the python ldap project Q During build there are warning messages displayed telling Lib ldap py and Lib ldap schema py are not found warning build py file Lib ldap py for module ldap not found warning build py file Lib ldap schema py for module ldap schema not found A ldap and ldap schema are both module packages directories containing various sub modules The messages above are falsely produced by DistUtils Don t worry about it Q While importing module ldap some shared lib files are not found Error message looks similar to this ImportError ld so 1 usr local bin python fatal liblber so 2 open failed No such file or directory A1 You need to make sure that the path to liblber so 2 and libldap so 2 is in your LD LIBRARY PATH environment variable A2 Alternatively if you re on Linux you can add the

    Original URL path: https://www.python-ldap.org/faq.html (2016-04-29)
    Open archived version from archive

  • python-ldap: Applications
    is a full featured web based LDAPv3 client with full schema support a schema browser and plugin support FreeIPA FreeIPA is an integrated security information management solution combining Linux Fedora 389 Directory Server MIT Kerberos NTP DNS Dogtag Certificate System

    Original URL path: https://www.python-ldap.org/apps.html (2016-04-29)
    Open archived version from archive

  • Building and installing — python-ldap 2.4.22.0 documentation
    OpenSSL optional http www openssl org cyrus sasl optional http www cyrussasl org Kerberos libs MIT or heimdal optional Furthermore some sub modules of ldap controls and ldap extop require pyasn1 and pyasn1 modules to be installed http pyasn1 sf net setup cfg The file setup cfg allows to set some build and installation parameters for reflecting the local installation of required software packages Only section ldap is described here More information about other sections can be found in the documentation of Python s DistUtils library dirs Specifies in which directories to search for required libraries include dirs Specifies in which directories to search for include files of required libraries libs A space separated list of library names to link to see Libs used extra compile args Compiler options extra objects Libs used ldap ldap r The LDAP protocol library of OpenLDAP ldap r is the reentrant version and should be preferred lber The BER encoder decoder library of OpenLDAP sasl2 The Cyrus SASL library if needed and present during build ssl The SSL TLS library of OpenSSL if needed and present during build crypto The basic cryptographic library of OpenSSL if needed and present during build Example The following

    Original URL path: https://www.python-ldap.org/doc/html/installing.html (2016-04-29)
    Open archived version from archive

  • python-ldap Documentation — python-ldap 2.4.22.0 documentation
    Constants General Options DN format flags Exceptions LDAPObject classes Arguments for LDAPv3 controls Sending LDAP requests Connection specific LDAP options Object attributes Example ldap async Stream processing of large search results Classes Examples Using ldap async List Using ldap async LDIFWriter ldap controls High level access to LDAPv3 extended controls Variables Classes Functions Sub modules ldap controls simple Very simple controls ldap controls libldap Various controls implemented in OpenLDAP libs ldap controls psearch LDAP Persistent Search ldap controls sessiontrack Session tracking control ldap controls readentry Read entry control ldap dn LDAP Distinguished Name handling Examples ldap extop High level access to LDAPv3 extended operations Classes ldap extop dds Classes for Dynamic Entries extended operations ldap filter LDAP filter handling ldap modlist Generate modify lists ldap resiter Generator for stream processing of large search results Examples Using ldap resiter ResultProcessor ldap schema Handling LDAPv3 schema ldap schema subentry Processing LDAPv3 subschema subentry Functions Classes ldap schema models Schema elements Examples for ldap schema ldap syncrepl Implementation of a syncrepl consumer Classes ldap sasl Handling LDAPv3 schema Constants Classes Examples for ldap sasl ldif LDIF parser and generator Functions Classes Example ldapurl LDAP URL handling Constants Functions Classes LDAP URLs LDAP URL

    Original URL path: https://www.python-ldap.org/doc/html/index.html (2016-04-29)
    Open archived version from archive

  • ldap LDAP library interface module — python-ldap 2.4.22.0 documentation
    The DSA is busy exception ldap CLIENT LOOP exception ldap COMPARE FALSE A compare operation returned false This exception should never be seen because compare returns a boolean result exception ldap COMPARE TRUE A compare operation returned true This exception should never be seen because compare returns a boolean result exception ldap CONFIDENTIALITY REQUIRED Indicates that the session is not protected by a protocol such as Transport Layer Security TLS which provides session confidentiality exception ldap CONNECT ERROR exception ldap CONSTRAINT VIOLATION An attribute value specified or an operation started violates some server side constraint e g a postalAddress has too many lines or a line that is too long or a password is expired exception ldap CONTROL NOT FOUND exception ldap DECODING ERROR An error was encountered decoding a result from the LDAP server exception ldap ENCODING ERROR An error was encountered encoding parameters to send to the LDAP server exception ldap FILTER ERROR An invalid filter was supplied to search e g unbalanced parentheses exception ldap INAPPROPRIATE AUTH Inappropriate authentication was specified e g AUTH SIMPLE was specified and the entry does not have a userPassword attribute exception ldap INAPPROPRIATE MATCHING Filter type not supported for the specified attribute exception ldap INSUFFICIENT ACCESS The user has insufficient access to perform the operation exception ldap INVALID CREDENTIALS Invalid credentials were presented during bind or simple bind e g the wrong password exception ldap INVALID DN SYNTAX A syntactically invalid DN was specified Sets the matched field exception ldap INVALID SYNTAX An attribute value specified by the client did not comply to the syntax defined in the server side schema exception ldap IS LEAF The object specified is a leaf of the diretcory tree Sets the matched field of the exception dictionary value exception ldap LOCAL ERROR Some local error occurred This is usually due to failed memory allocation exception ldap LOOP DETECT A loop was detected exception ldap MORE RESULTS TO RETURN exception ldap NAMING VIOLATION A naming violation occurred This is raised e g if the LDAP server has constraints about the tree naming exception ldap NO OBJECT CLASS MODS Modifying the objectClass attribute as requested is not allowed e g modifying structural object class of existing entry exception ldap NOT ALLOWED ON NONLEAF The operation is not allowed on a non leaf object exception ldap NOT ALLOWED ON RDN The operation is not allowed on an RDN exception ldap NOT SUPPORTED exception ldap NO MEMORY exception ldap NO OBJECT CLASS MODS Object class modifications are not allowed exception ldap NO RESULTS RETURNED exception ldap NO SUCH ATTRIBUTE The attribute type specified does not exist in the entry exception ldap NO SUCH OBJECT The specified object does not exist in the directory Sets the matched field of the exception dictionary value exception ldap OBJECT CLASS VIOLATION An object class violation occurred when the LDAP server checked the data sent by the client against the server side schema e g a must attribute was missing in the entry data exception ldap OPERATIONS ERROR An operations error occurred exception ldap OTHER An unclassified error occurred exception ldap PARAM ERROR An ldap routine was called with a bad parameter exception ldap PARTIAL RESULTS Partial results only returned This exception is raised if a referral is received when using LDAPv2 This exception should never be seen with LDAPv3 exception ldap PROTOCOL ERROR A violation of the LDAP protocol was detected exception ldap RESULTS TOO LARGE The result does not fit into a UDP packet This happens only when using UDP based CLDAP connection less LDAP which is not supported anyway exception ldap SASL BIND IN PROGRESS exception ldap SERVER DOWN The LDAP library can t contact the LDAP server exception ldap SIZELIMIT EXCEEDED An LDAP size limit was exceeded This could be due to a sizelimit configuration on the LDAP server exception ldap STRONG AUTH NOT SUPPORTED The LDAP server does not support strong authentication exception ldap STRONG AUTH REQUIRED Strong authentication is required for the operation exception ldap TIMELIMIT EXCEEDED An LDAP time limit was exceeded exception ldap TIMEOUT A timelimit was exceeded while waiting for a result from the server exception ldap TYPE OR VALUE EXISTS An attribute type or attribute value specified already exists in the entry exception ldap UNAVAILABLE The DSA is unavailable exception ldap UNAVAILABLE CRITICAL EXTENSION Indicates that the LDAP server was unable to satisfy a request because one or more critical extensions were not available Either the server does not support the control or the control is not appropriate for the operation type exception ldap UNDEFINED TYPE An attribute type used is not defined in the server side schema exception ldap UNWILLING TO PERFORM The DSA is unwilling to perform the operation exception ldap USER CANCELLED The operation was cancelled via the abandon method The above exceptions are raised when a result code from an underlying API call does not indicate success LDAPObject classes class ldap LDAPObject Instances of LDAPObject are returned by initialize and open deprecated The connection is automatically unbound and closed when the LDAP object is deleted Internally LDAPObject is set to SimpleLDAPObject by default class ldap SimpleLDAPObject uri trace level 0 trace file sys stdout trace stack limit 5 Instances of LDAPObject are returned by initialize and open deprecated The connection is automatically unbound and closed when the LDAP object is deleted class ldap ReconnectLDAPObject uri trace level 0 trace file sys stdout trace stack limit 5 retry max 1 retry delay 60 0 This class is derived from SimpleLDAPObject and used for automatic reconnects when using the synchronous request methods see below This class also implements the pickle protocol For automatic reconnects it has additional arguments retry max specifies the number of reconnect attempts before re raising the ldap SERVER DOWN exception retry delay specifies the time in seconds between reconnect attempts Arguments for LDAPv3 controls The ldap controls module can be used for constructing and decoding LDAPv3 controls These arguments are available in the methods with names ending in ext or ext s serverctrls is a list of ldap controls LDAPControl instances sent to the server along with the LDAP request see module ldap controls These are controls which alter the behaviour of the server when processing the request if the control is supported by the server The effect of controls might differ depending on the type of LDAP request or controls might not be applicable with certain LDAP requests at all clientctrls is a list of ldap controls LDAPControl instances passed to the client API and alter the behaviour of the client when processing the request Sending LDAP requests Most methods on LDAP objects initiate an asynchronous request to the LDAP server and return a message id that can be used later to retrieve the result with result Methods with names ending in s are the synchronous form and wait for and return with the server s result or with None if no data is expected LDAPObject instances have the following methods LDAPObject abandon msgid None LDAPObject abandon ext msgid serverctrls None clientctrls None None Abandons an LDAP operation in progress without waiting for a LDAP response The msgid argument should be the message ID of an outstanding LDAP operation as returned by the asynchronous methods search modify etc The caller can expect that the result of an abandoned operation will not be returned from a future call to result serverctrls and clientctrls like described above LDAPObject add dn modlist int LDAPObject add s dn modlist None LDAPObject add ext dn modlist serverctrls None clientctrls None int LDAPObject add ext s dn modlist serverctrls None clientctrls None None Performs an LDAP add operation The dn argument is the distinguished name DN of the entry to add and modlist is a list of attributes to be added The modlist is similar the one passed to modify except that the operation integer is omitted from the tuples in modlist You might want to look into sub module refmodule ldap modlist for generating the modlist The asynchronous methods add and add ext return the message ID of the initiated request serverctrls and clientctrls like described above LDAPObject bind who cred method int LDAPObject bind s who cred method None LDAPObject simple bind who cred serverctrls None clientctrls None int LDAPObject simple bind s who cred serverctrls None clientctrls None None After an LDAP object is created and before any other operations can be attempted over the connection a bind operation must be performed This method attempts to bind with the LDAP server using either simple authentication or Kerberos if available The first and most general method bind takes a third parameter method which can currently solely be AUTH SIMPLE LDAPObject sasl interactive bind s who auth None This call is used to bind to the directory with a SASL bind request LDAPObject cancel cancelid serverctrls None clientctrls None None Send cancels extended operation for an LDAP operation specified by cancelid The cancelid should be the message id of an outstanding LDAP operation as returned by the asynchronous methods search modify etc The caller can expect that the result of an abandoned operation will not be returned from a future call to result In opposite to abandon this extended operation gets an result from the server and thus should be preferred if the server supports it serverctrls and clientctrls like described above RFC 3909 Lightweight Directory Access Protocol LDAP Cancel Operation LDAPObject compare dn attr value int LDAPObject compare s dn attr value tuple LDAPObject compare ext dn attr value serverctrls None clientctrls None int LDAPObject compare ext s dn attr value serverctrls None clientctrls None tuple Perform an LDAP comparison between the attribute named attr of entry dn and the value value The synchronous forms returns 0 for false or 1 for true The asynchronous forms returns the message ID of the initiated request and the result of the asynchronous compare can be obtained using result Note that the asynchronous technique yields the answer by raising the exception objects ldap COMPARE TRUE or ldap COMPARE FALSE serverctrls and clientctrls like described above Note A design fault in the LDAP API prevents value from containing NULL characters LDAPObject delete dn int LDAPObject delete s dn None LDAPObject delete ext dn serverctrls None clientctrls None int LDAPObject delete ext s dn serverctrls None clientctrls None None Performs an LDAP delete operation on dn The asynchronous form returns the message id of the initiated request and the result can be obtained from a subsequent call to result serverctrls and clientctrls like described above ldap extop extreq serverctrls None clientctrls None int ldap extop s extreq serverctrls None clientctrls None extop resp class None respoid respvalue Performs an LDAP extended operation The asynchronous form returns the message id of the initiated request and the result can be obtained from a subsequent call to extop result The extreq is an instance of class ldap extop ExtendedRequest containing the parameters for the extended operation request If argument extop resp class is set to a sub class of ldap extop ExtendedResponse this class is used to return an object of this class instead of a raw BER value in respvalue ldap extop result self msgid ldap RES ANY all 1 timeout None respoid respvalue Wrapper method around result4 just for retrieving the result of an extended operation sent before LDAPObject modify dn modlist int LDAPObject modify s dn modlist None LDAPObject modify ext dn modlist serverctrls None clientctrls None int LDAPObject modify ext s dn modlist serverctrls None clientctrls None None Performs an LDAP modify operation on an entry s attributes The dn argument is the distinguished name DN of the entry to modify and modlist is a list of modifications to make to that entry Each element in the list modlist should be a tuple of the form mod op mod type mod vals where mod op indicates the operation one of ldap MOD ADD ldap MOD DELETE or ldap MOD REPLACE mod type is a string indicating the attribute type name and mod vals is either a string value or a list of string values to add delete or replace respectively For the delete operation mod vals may be None indicating that all attributes are to be deleted serverctrls and clientctrls like described above The asynchronous methods modify and modify ext return the message ID of the initiated request You might want to look into sub module ldap modlist for generating modlist LDAPObject modrdn dn newrdn delold 1 int LDAPObject modrdn s dn newrdn delold 1 None Perform a modify RDN operation i e a renaming operation These routines take dn the DN of the entry whose RDN is to be changed and newrdn the new RDN to give to the entry The optional parameter delold is used to specify whether the old RDN should be kept as an attribute of the entry or not The asynchronous version returns the initiated message id This operation is emulated by rename and rename s methods since the modrdn2 routines in the C library are deprecated LDAPObject passwd user oldpw newpw serverctrls None clientctrls None int LDAPObject passwd s user oldpw newpw serverctrls None clientctrls None None Perform a LDAP Password Modify Extended Operation operation on the entry specified by user The old password in oldpw is replaced with the new password in newpw by a LDAP server supporting this operation If oldpw is not None it has to match the old password of the specified user which is sometimes used when a user changes his own password serverctrls and clientctrls like described above The asynchronous version returns the initiated message id See also RFC 3062 LDAP Password Modify Extended Operation LDAPObject rename dn newrdn newsuperior None delold 1 serverctrls None clientctrls None int LDAPObject rename s dn newrdn newsuperior None delold 1 serverctrls None clientctrls None None Perform a Rename operation i e a renaming operation These routines take dn the DN of the entry whose RDN is to be changed and newrdn the new RDN to give to the entry The optional parameter newsuperior is used to specify a new parent DN for moving an entry in the tree not all LDAP servers support this The optional parameter delold is used to specify whether the old RDN should be kept as an attribute of the entry or not serverctrls and clientctrls like described above LDAPObject result msgid RES ANY all 1 timeout None 2 tuple This method is used to wait for and return the result of an operation previously initiated by one of the LDAP asynchronous operations eg search modify etc The msgid parameter is the integer identifier returned by that method The identifier is guaranteed to be unique across an LDAP session and tells the result method to request the result of that specific operation If a result is desired from any one of the in progress operations msgid should be specified as the constant RES ANY and the method result2 should be used instead The all parameter only has meaning for search responses and is used to select whether a single entry of the search response should be returned or to wait for all the results of the search before returning A search response is made up of zero or more search entries followed by a search result If all is 0 search entries will be returned one at a time as they come in via separate calls to result If all is 1 the search response will be returned in its entirety i e after all entries and the final search result have been received For all set to 0 result tuples trickle in with the same message id and with the result types RES SEARCH ENTRY and RES SEARCH REFERENCE until the final result which has a result type of RES SEARCH RESULT and a usually empty data field When all is set to 1 only one result is returned with a result type of RES SEARCH RESULT and all the result tuples listed in the data field The timeout parameter is a limit on the number of seconds that the method will wait for a response from the server If timeout is negative which is the default the method will wait indefinitely for a response The timeout can be expressed as a floating point value and a value of 0 effects a poll If a timeout does occur a ldap TIMEOUT exception is raised unless polling in which case None None is returned The result method returns a tuple of the form result type result data The first element result type is a string being one of these module constants RES BIND RES SEARCH ENTRY RES SEARCH REFERENCE RES SEARCH RESULT RES MODIFY RES ADD RES DELETE RES MODRDN or RES COMPARE If all is 0 one response at a time is returned on each call to result with termination indicated by result data being an empty list See search for a description of the search result s result data otherwise the result data is normally meaningless LDAPObject result2 msgid RES ANY all 1 timeout None 3 tuple This method behaves almost exactly like result But it returns a 3 tuple also containing the message id of the outstanding LDAP operation a particular result message belongs to This is especially handy if one needs to dispatch results obtained with msgid RES ANY to several consumer threads which invoked a particular LDAP operation LDAPObject result3 msgid RES ANY all 1 timeout None 4 tuple This method behaves almost exactly like result2 But it returns an extra item in the tuple the decoded server controls LDAPObject result4 msgid RES ANY all 1 timeout None add ctrls 0 add intermediates 0 add extop 0 resp ctrl classes None 6 tuple This method behaves almost exactly like result3 But it returns an extra items in the tuple the decoded results of an extended response The additional arguments are add ctrls integer flag specifies whether response

    Original URL path: https://www.python-ldap.org/doc/html/ldap.html (2016-04-29)
    Open archived version from archive



  •