# LDAPError when login

**URL:** https://discuss.tryton.org/t/ldaperror-when-login/6317
**Category:** Developer
**Created:** [July 3, 2023, 12:17pm UTC](https://discuss.tryton.org/t/ldaperror-when-login/6317 "2023-07-03T12:17:44Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![bell](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@bell](https://discuss.tryton.org/u/bell)
#### Post date: [July 3, 2023, 12:17pm UTC](https://discuss.tryton.org/t/ldaperror-when-login/6317/1 "2023-07-03T12:17:44Z")

</div>

Hi,  
What does this message mean?

```auto
Fri Jun 30 17:27:46 2023] ERROR:trytond.modules.ldap_authentication.res:LDAPError when login
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/trytond/modules/ldap_authentication/res.py", line 141, in _login_ldap
    with ldap3.Connection(server, dn, password) as con:
  File "/usr/local/lib/python3.8/site-packages/ldap3/core/connection.py", line 534, in __enter__
    raise LDAPBindError('unable to bind')
ldap3.core.exceptions.LDAPBindError: unable to bind

```

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [July 3, 2023, 12:24pm UTC](https://discuss.tryton.org/t/ldaperror-when-login/6317/2 "2023-07-03T12:24:04Z")

</div>

It means that the configuration for the LDAP connection is not working.

---

<div class="post-metadata">

### Author: ![bell](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@bell](https://discuss.tryton.org/u/bell)
#### Post date: [July 3, 2023, 12:28pm UTC](https://discuss.tryton.org/t/ldaperror-when-login/6317/3 "2023-07-03T12:28:23Z")

</div>

We normally connect to the server. But with every login we get this message.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [July 3, 2023, 12:52pm UTC](https://discuss.tryton.org/t/ldaperror-when-login/6317/4 "2023-07-03T12:52:10Z")

</div>

Well I guess you authenticate with another method than LDAP but you have LDAP configured as one of the authentication method but it is failing to connect to the server.

---

<div class="post-metadata">

### Author: ![bell](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@bell](https://discuss.tryton.org/u/bell)
#### Post date: [July 5, 2023, 11:50am UTC](https://discuss.tryton.org/t/ldaperror-when-login/6317/5 "2023-07-05T11:50:13Z")

</div>

Can you tell me, please, where is the configuration file for LDAP connection?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [July 5, 2023, 12:52pm UTC](https://discuss.tryton.org/t/ldaperror-when-login/6317/6 "2023-07-05T12:52:21Z")

</div>

In the trytond configuration under the [section [ldap\_authentication]](https://docs.tryton.org/projects/modules-ldap-authentication/en/latest/).

---

<div class="post-metadata">

### Author: ![bell](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@bell](https://discuss.tryton.org/u/bell)
#### Post date: [July 5, 2023, 1:55pm UTC](https://discuss.tryton.org/t/ldaperror-when-login/6317/7 "2023-07-05T13:55:08Z")

</div>

Here is our section:

```auto
[ldap_authentication]
uri = ldap://ldap:389/ou=People,dc=ilt,dc=ua?uid?onelevel

```

What’s wrong with it?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [July 5, 2023, 2:00pm UTC](https://discuss.tryton.org/t/ldaperror-when-login/6317/8 "2023-07-05T14:00:19Z")

</div>

I can not say. But it is not enough to bind to your LDAP server. Maybe you need a `bind_pass`.

---

<div class="post-metadata">

### Author: ![bell](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@bell](https://discuss.tryton.org/u/bell)
#### Post date: [July 5, 2023, 4:46pm UTC](https://discuss.tryton.org/t/ldaperror-when-login/6317/9 "2023-07-05T16:46:38Z")

</div>

We have set the `bind_pass` password. Nothing changed. The message `unable to bind` remains.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [July 5, 2023, 4:57pm UTC](https://discuss.tryton.org/t/ldaperror-when-login/6317/10 "2023-07-05T16:57:44Z")

</div>

Maybe you need to define a `bindname`.  
You should read the [ldap3 documentation](https://ldap3.readthedocs.io/en/latest/) to learn the correct way to connect to your LDAP server.
