isanaud | J'aimerais faire une petite requete ldap mais je suis confronté à l'erreur suivante.
Je ne vois pas d'où vient le probleme, est ce la requete ou la connexion au serveur ldap ?
Code :
- Python 3.6.8 (default, Nov 17 2021, 16:10:06)
- [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] on linux
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import ldap
- >>> searchFilter = "uid=monutilisateur"
- >>> basedn = "ou=People,dc=univ-sarthe,dc=fr"
- >>> searchScope = "ldap.SCOPE_SUBTREE"
- >>> searchAttribute= ['uid']
- >>> connection = ldap.initialize('ldaps://ldap.univ-sarthe.fr:636')
- >>> connection.set_option(ldap.OPT_REFERRALS, 0)
- >>> connection.protocol_version = ldap.VERSION3
- >>> connection.simple_bind_s('cn=monusertoconnect,ou=applications,dc=univ-sarthe,dc=fr', 'monusertoconnectpass')
- (97, [], 1, [])
- >>> ldap_result_id = connection.search_s(basedn, searchScope, searchFilter, searchAttribute)
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- File "/usr/local/lib64/python3.6/site-packages/ldap/ldapobject.py", line 631, in search_s
- return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout=self.timeout)
- File "/usr/local/lib64/python3.6/site-packages/ldap/ldapobject.py", line 624, in search_ext_s
- msgid = self.search_ext(base,scope,filterstr,attrlist,attrsonly,serverctrls,clientctrls,timeout,sizelimit)
- File "/usr/local/lib64/python3.6/site-packages/ldap/ldapobject.py", line 620, in search_ext
- timeout,sizelimit,
- File "/usr/local/lib64/python3.6/site-packages/ldap/ldapobject.py", line 128, in _ldap_call
- result = func(*args,**kwargs)
- TypeError: an integer is required (got type str)
|
|