I have a ldap server which is configured like this:
cn=adminuser,dc=compnay,dc=com
Then i have ccreate ou=users
.
I want to add some users to this ou
with the intention of authenticating them from my python
application.
so the tree looks something like this:
* cn=adminuser,dc=compnay,dc=com
* users
- sam
- Laurie
- Joe
with some attributes assigned to all users like mobile
, email
.
When i want to authenticate the users from the user form, i cannot bind using the connection(user='ou=users,cn=sam,dc=company,dc=com',password=mypassword)
I have assigned password
& cn
to all users.
Expected: Users will get authenticated.
Output:
Bind error.invalidCredentials
When i use the full DN
in connection()
exou=groups,cn=sam,mobile=xxxxx,email=sam@sam.com
, it works but obvously i cannot ask each user to enter all details while authenticating,
is there any mistake in my understanding of user authentication via ldap?
NOTE i am using python ldap3
library.