# Ldap configuration not working

**URL:** <https://forum.gitea.com/t/ldap-configuration-not-working/2184>\
**Category:** Install/Maintain/Configure\
**Created:** [May 27, 2020, 9:25pm UTC](https://forum.gitea.com/t/ldap-configuration-not-working/2184 "2020-05-27T21:25:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![romain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/romain/32/4923_2.png) [@romain](https://forum.gitea.com/u/romain)\
**Post date:** [May 27, 2020, 9:25pm UTC](https://forum.gitea.com/t/ldap-configuration-not-working/2184/1 "2020-05-27T21:25:52Z")

</div>

Hi!  
So I have a very simple ldap setup where I have some users, and I want gitea to use those ldap users.  
I have configured my ldap settings like this  
LDAP (via BindDN)  
(I will not put the basic parameters here)  
User search base: ou=people,dc=domain,dc=lan  
User filter: (&(objectClass=posixAccount))  
User Attribute: uid  
Email attribute: mail.

I have tried to synchronize but no users seems to be added.

I have make sure that the user filter works, using this:

ldapsearch -x -b ‘ou=people,dc=domain,dc=lan’ -H ldap://"(&(objectClass=posixAccount))"

And I got all my users so the filter is working

Still the log of my lda server only show this when I try to synchronize:

May 27 17:22:54 pdrldap01 slapd[9281]: conn=5422 fd=22 ACCEPT from IP=192.168.4.22:44528 (IP=0.0.0.0:389)  
May 27 17:22:54 pdrldap01 slapd[9281]: conn=5422 op=0 BIND dn=“cn=ldapadmin,dc=digitalrat,dc=lan” method=128  
May 27 17:22:54 pdrldap01 slapd[9281]: conn=5422 op=0 BIND dn=“cn=ldapadmin,dc=domain,dc=lan” mech=SIMPLE ssf=0  
May 27 17:22:54 pdrldap01 slapd[9281]: conn=5422 op=0 RESULT tag=97 err=0 text=  
May 27 17:22:54 pdrldap01 slapd[9281]: conn=5422 fd=22 closed (connection lost)

192.168.4.22 is my gitea server. For what I see, gitea was able to bind using the user ldapadmin but after that…nothing.

I can’t find on gitea any logs explain this so any help to make it works will be more than welcome 🙂  
Thanks!

---

<div class="post-metadata">

**Author:** ![romain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/romain/32/4923_2.png) [@romain](https://forum.gitea.com/u/romain)\
**Post date:** [May 27, 2020, 9:43pm UTC](https://forum.gitea.com/t/ldap-configuration-not-working/2184/2 "2020-05-27T21:43:24Z")

</div>

Hello,  
So I found this in the log:

2020/05/27 21:42:25 …es/auth/ldap/ldap.go:353:SearchEntries() [E] LDAP Search failed unexpectedly! (LDAP Result Code 201 “Filter Compile Error”: ldap: finished compiling filter with extra at end: %!(EXTRA string=\*))  
2020/05/27 21:42:25 models/user.go:1772:SyncExternalUsers() [E] SyncExternalUsers LDAP source failure [pdrldap01], skipped

Not sure what it means…

---

<div class="post-metadata">

**Author:** ![romain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/romain/32/4923_2.png) [@romain](https://forum.gitea.com/u/romain)\
**Post date:** [May 27, 2020, 9:52pm UTC](https://forum.gitea.com/t/ldap-configuration-not-working/2184/3 "2020-05-27T21:52:45Z")

</div>

Helllo,  
So (uid=%s) seems to work right now, I can see the user. No I need to go more granulart to only after a subset of users in this group
