0

Consider a LDAP URL ldap:///CN=Services,CN=Configuration,DC=com?testfile;binary

I know /// means my local machine is already communicating with the LDAP server or it has some knowledge about the LDAP server.

Now, How do I connect using ldap3 library using ldap3.Server() or ldap3.Connection() objects?

In the documentation of ldap3, it is mentioned that hostname is not an optional parameter. I am wrong here?

Sushruth N
  • 191
  • 2
  • 15
  • The RFC states "If no hostport is given, the client must have some apriori knowledge of an appropriate LDAP server to contact" Does your client have that? Client in that sense is the `Server` instance in your application. – Klaus D. Nov 09 '18 at 07:32
  • @KlausD. My client has knowledge of the LDAP server. But I don't know the parameters to specify in ldap3.server() object – Sushruth N Nov 09 '18 at 07:52
  • Also consider that the server is an active directory. So specifying address with /// will hit the closest domain controller. – Sushruth N Nov 09 '18 at 08:10
  • Obviously in your program it does not. You are assuming that your client knows about the LDAP server but you are missing the fact that your Python program is not the OS, that might be connected to the Active Directory. The OS know the server, your client does not. You either have to find a way to ask the OS for the server or supply it manually. – Klaus D. Nov 09 '18 at 09:08
  • @KlausD. is there any way to ask the OS for the server information? – Sushruth N Nov 09 '18 at 09:10

0 Answers0