0

I am using Online LDAP Test Server(https://www.forumsys.com/tutorials/integration-how-to/ldap/online-ldap-test-server/)

I am trying to connect to it using python ldap3 module.

This is my code:

import ldap3
user = 'riemann'
password = 'password'
server = ldap3.Server('ldap.forumsys.com', port=389)
connection = ldap3.Connection(server, user=user, password=password)
connection.bind()
conn = connection.search(search_base='ou=mathematicians,dc=example,dc=com', search_filter='(&(objectClass=user)(userPrincipalName='+user+'))', attributes='*')

print conn

When I check the conn it is False.

Can someone help me in getting the connection Thanks in advance

GopiKrishna
  • 109
  • 1
  • 6
  • The following are [30 code examples](https://www.programcreek.com/python/example/107944/ldap3) for showing how to use `ldap3` and [Tutorial: Introduction to ldap3](https://ldap3.readthedocs.io/en/latest/tutorial_intro.html#tutorial-introduction-to-ldap3). – Milovan Tomašević Jan 26 '21 at 19:12

1 Answers1

1

if you change user='riemann' to user='uid=riemann,dc=example,dc=com' you'll get a connection

for more information check the docs: http://ldap3.readthedocs.io/bind.html#simple-bind

ddp
  • 122
  • 8