Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP invalidCredentials Error #709

Closed
anees30 opened this issue Jun 25, 2019 · 11 comments
Closed

LDAP invalidCredentials Error #709

anees30 opened this issue Jun 25, 2019 · 11 comments

Comments

@anees30
Copy link

anees30 commented Jun 25, 2019

Using Python 3.6.7 and ldap3-2.6
The following code raises invalidCredentials when proper user DN and password are used.

from ldap3 import Server, Connection, ALL, NTLM
server = Server('192.168.55.73', get_info=ALL)
conn = Connection(server, 'uid=username@domain.com,OU=IT,OU=Office Users,OU=RUG,OU=Accounts,DC=domain,DC=com', 'password411', auto_bind=False)
if not conn.bind():
    print('error in bind', conn.result)
else:
    print('Connection Successful', conn.result)

Here is the error
error in bind {'result': 49, 'description': 'invalidCredentials', 'dn': '', 'message': '80090308: LdapErr: DSID-0C090400, comment: AcceptSecurityContext error, data 52e, v1db1\x00', 'referrals': None, 'saslCreds': None, 'type': 'bindResponse'}
Please guide what is missing...?
For more information here is the screen short...
LDAP Binding failed

@fpatterson55
Copy link

fpatterson55 commented Jun 25, 2019 via email

@anees30
Copy link
Author

anees30 commented Jun 25, 2019

@fpatterson55 I tried with cn but same result.

>>> conn = Connection(server, 'cn=9999,OU=IT,OU=Office Users,OU=RUG,OU=Accounts,DC=domainr,DC=com', 'password4111', auto_bind=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/anees/.local/lib/python3.6/site-packages/ldap3/core/connection.py", line 325, in __init__
    self.do_auto_bind()
  File "/home/anees/.local/lib/python3.6/site-packages/ldap3/core/connection.py", line 353, in do_auto_bind
    raise LDAPBindError(self.last_error)
ldap3.core.exceptions.LDAPBindError: automatic bind not successful - invalidCredentials

cn=9999 or cn=9999@domain.com which is correct.
"Does your bind work with Apache Directory Studio?"... no idea about this...

@fpatterson55
Copy link

fpatterson55 commented Jun 25, 2019 via email

@anees30
Copy link
Author

anees30 commented Jun 25, 2019

@fpatterson55
This code is working but without DN parameters passed...

>>> from ldap3 import Server, Connection, SIMPLE, SYNC, ALL, SASL, NTLM
>>> c = Connection(s, user="AUTHTEST\\adminuser", password="adminpwd", authentication=NTLM)
>>> if not c.bind():
...     print('error in bind', c.result)
... else:
...     print('Connection Successful', c.result)
Connection Successful {'result': 0, 'description': 'success', 'dn': '', 'message': '', 'referrals': None, 'saslCreds': None, 'type': 'bindResponse'}

But what I am looking for is LDAP base and filter. This information is required to use in an ERP application to login and authenticate with Windows Active Directory users....
Please see the pic where the LDPA information required in our ERP system..
Please guide how to get all there LDAP parameters required from AD shown in this pic from our AD...

ladapsettings

@anees30
Copy link
Author

anees30 commented Jun 25, 2019

These are my settings in our ERP System
LDAP base = CN=Users,DC=domain,DC=com
LDAP filter = sAMAccountName=%s

When I login with AD user getting following error....

2019-06-25 14:50:30,114 1999 ERROR hrdemo odoo.addons.auth_ldap.models.res_company_ldap: LDAP bind failed.

Any idea what could be the base and filter? and how to get it from AD?

@fpatterson55
Copy link

fpatterson55 commented Jun 25, 2019 via email

@anees30
Copy link
Author

anees30 commented Jun 25, 2019

I am not Linux based. Could you please share the ldapsearch syntax.

@fpatterson55
Copy link

fpatterson55 commented Jun 25, 2019 via email

@anees30
Copy link
Author

anees30 commented Jun 25, 2019

Where to install apache directory studio.
On the Windows Active Directory Server?
Or any computer in the same network?
I have a Virtual Machine running Ubuntu in the same network?
apache directory studio will it list our existing Windows AD users. What information apache directory studio need to list AD? Thanks.

@anees30
Copy link
Author

anees30 commented Jun 26, 2019

@fpatterson55 I have installed apache directory studio on a computer in the network. Given host, Bind User and Bind password. It connected successfully.
Now what information I can get from it to solve my problem?
apache
Thanks

@anees30
Copy link
Author

anees30 commented Jun 26, 2019

Now I am getting a different error when logging to odoo erp..

2019-06-26 06:25:11,330 2156 ERROR hrdemo odoo.addons.auth_ldap.models.res_company_ldap: An LDAP exception occurred: {'desc': "Can't contact LDAP server", 'errno': 107, 'info': 'Transport endpoint is not connected'}

What could be the reason...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants