# LDAP Groups not functional

**URL:** <https://forums.rocket.chat/t/ldap-groups-not-functional/5773>\
**Category:** Community Support\
**Created:** [February 7, 2020, 8:23am UTC](https://forums.rocket.chat/t/ldap-groups-not-functional/5773 "2020-02-07T08:23:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![romah](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/romah/32/1481_2.png) [@romah](https://forums.rocket.chat/u/romah)\
**Post date:** [February 7, 2020, 8:23am UTC](https://forums.rocket.chat/t/ldap-groups-not-functional/5773/1 "2020-02-07T08:23:51Z")

</div>

Hi All,  
I’ve setup rocketchat and have basic LDAP setup - the next step of my deployment is to have channels based on LDAP user group.

I can successfully login when i have “Sync LDAP groups” Disabled but cannot login with it enabled.

My LDAP server is a Active Directory server running on Server 2016.

Here are my settings -

User Group Filer -  
" (&(objectCategory=Person)(sAMAccountName=#{username})(memberOf:1.2.840.113556.1.4.1941:=cn=#{groupName},OU=Protected Groups,OU=Administrative Groups,OU=Gatekeeper,DC=DOMAIN,DC=net)) "

LDAP Group BaseDN -  
" dc=DOMAIN,dc=net "

User Data Group Map -  
" {“Domain Admins”:“admin”,“Domain Users”:“user” }"

LDAP Group Channel Map -  
" {“Domain Users”:“announcements”} "

### Server Setup Information

- Version of Rocket.Chat Server: 2.4.1
- Operating System: rocket.chat docker container installed on CentOS
- Deployment Method: Docker
- Number of Running Instances: 1
- DB Replicaset Oplog: Enabled
- NodeJS Version: 8.15.1 - x64
- MongoDB Version: 4.0.16
- Proxy: NGINX
- Firewalls involved: Yes

### Any additional Information

Logs taken from Rocketchat server -  
“Exception while invoking method ‘login’ TypeError: Cannot read property ‘searchAllSync’ of undefined at isUserInLDAPGroup (app/ldap/server/sync.js:34:22) at mapLdapGroupsToUserRoles (app/ldap/server/sync.js:252:7) at syncUserData (app/ldap/server/sync.js:344:20) at addLdapUser (app/ldap/server/sync.js:458:2) at MethodInvocation. (app/ldap/server/loginHandler.js:150:17) at tryLoginMethod (packages/accounts-base/accounts\_server.js:460:31) at tryLoginMethod (packages/accounts-base/accounts\_server.js:1294:14) at AccountsServer.\_runLoginHandlers (packages/accounts-base/accounts\_server.js:458:22) at AccountsServer.Accounts.\_runLoginHandlers (app/lib/server/lib/loginErrorMessageOverride.js:7:35) at MethodInvocation.methods.login (packages/accounts-base/accounts\_server.js:518:31) at maybeAuditArgumentChecks (packages/ddp-server/livedata\_server.js:1771:12) at DDP.\_CurrentMethodInvocation.withValue (packages/ddp-server/livedata\_server.js:719:19) at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12) at DDPServer.\_CurrentWriteFence.withValue (packages/ddp-server/livedata\_server.js:717:46) at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12) at Promise (packages/ddp-server/livedata\_server.js:715:46) at new Promise () at Session.method (packages/ddp-server/livedata\_server.js:689:23) at packages/ddp-server/livedata\_server.js:559:43”

Any help would be much appreciated.

---

<div class="post-metadata">

**Author:** ![phatair](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@phatair](https://forums.rocket.chat/u/phatair)\
**Post date:** [February 7, 2020, 9:26am UTC](https://forums.rocket.chat/t/ldap-groups-not-functional/5773/2 "2020-02-07T09:26:08Z")

</div>

i have the same problem with AD 2012R2.  
Look here

> [@Active directory Group integration V2.0.0](https://forums.rocket.chat/t/active-directory-group-integration-v2-0-0/4664/3):
>
> the Problem has been solved. The key in this case was the inclusion of the nesting Filter to get nested Groups working. The format looks like this: (&(sAMAccountName=#{username})(memberof:1.2.840.113556.1.4.1941:=CN=#{groupName},DC=your domain (objectCategory=person)(objectClass=user)) We included the category and class filter to rule out false positives like the nested security groups.

and here

> [@Login after using LDAP Group Channel Map not possible](https://forums.rocket.chat/t/login-after-using-ldap-group-channel-map-not-possible/5724):
>
> Description We are using Rocket Chat with AD Integration and AD Sync. We also use User Data Group Map and LDAP Group Channel Map. We have two existing LDAP Group Channel Map entrys and that is working fine. If we add Users to the AD Group where the user search filter is set to, these users are created correctly. Now i add a third LDAP Group Channel Map entry. After that i can not login anymore in Rocket Chat.The new LDAP Group is created in Rocket Chat but no user can login. If i delete this …

i also wrote some infos on a existing github pull request but dont get any answer.

> <https://github.com/RocketChat/Rocket.Chat/pull/14278#issuecomment-582381801>
>
> Hello,
> 
> we are using the following configuration
> \*\*Server Setup Information\*\*…
> Version of Rocket.Chat Server: 2.4.2
> Operating System: Ubuntu LTS
> Deployment Method: snap
> Number of Running Instances: 1
> DB Replicaset Oplog:
> NodeJS Version: v8.17.0
> MongoDB Version: 3.6.14
> Proxy: caddy
> Firewalls involved:no
> 
> If we enable "Auto Sync LDAP Groups to Channels", one user can login. After this login the Channels are created and now no one else can login to rocket chat. They got an error message "wrong user or passwort". If i logout with this user, the user can not login anymore. I have to delete these channels with the rocket chat admin and then the same happens - i can login one time, channels are created and no login is possible after that.
> 
> If i disable LDAP Group to Channel Sync the AD Authenthication is working fine.
> 
> The Config looks like this:
> \*\*Base DN\*\*
> OU=KTS,DC=my,DC=domain,DC=com
> \*\*User Group Filter\*\*
> (&(sAMAccountName=#{username})(memberOf:1.2.840.113556.1.4.1941:=CN=#{groupName},OU=RocketChat,OU=SecurityGroups,OU=KTS,DC=my,DC=domain,DC=com))
> \*\*LDAP Group BaseDN\*\*
> OU=KTS,DC=my,DC=domain,DC=com
> \*\*User Search filter\*\*
> (&(objectCategory=person)(objectclass=user)(memberOf:1.2.840.113556.1.4.1941:=CN=RC\_Users,OU=RocketChat,OU=SecurityGroup,OU=KTS,DC=my,DC=domain,DC=com))
> 
> Any Idea whats going wrong? I was doing my first tests with a earlier version and the Group Sync was working fine.

i had the same error message and some others like User still exists.  
Until now i dont get any support.

---

<div class="post-metadata">

**Author:** ![romah](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/romah/32/1481_2.png) [@romah](https://forums.rocket.chat/u/romah)\
**Post date:** [February 7, 2020, 12:02pm UTC](https://forums.rocket.chat/t/ldap-groups-not-functional/5773/3 "2020-02-07T12:02:31Z")

</div>

Thanks for your response, it seems that some people are successfully deploying RocketChat with AD but also some people facing issues.  
Unsure how to proceed as i’d like to get RocketChat implemented for our company but cannot implement the groups with AD.

Disappointing as we’d look to buy the enterprise versions once this is deployed.

---

<div class="post-metadata">

**Author:** ![phatair](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@phatair](https://forums.rocket.chat/u/phatair)\
**Post date:** [February 12, 2020, 6:48am UTC](https://forums.rocket.chat/t/ldap-groups-not-functional/5773/4 "2020-02-12T06:48:11Z")

</div>

Yes, we have the same problem. We want to test rocket chat and if it runs smoothly we think about the enterprise version but with this problems we cant implement rocket chat.

Are we the only one who has this problems? I cant image that this is a config problem…?

---

<div class="post-metadata">

**Author:** ![marianoabdala](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@marianoabdala](https://forums.rocket.chat/u/marianoabdala)\
**Post date:** [February 12, 2020, 11:19am UTC](https://forums.rocket.chat/t/ldap-groups-not-functional/5773/5 "2020-02-12T11:19:30Z")

</div>

![rocket](https://us1.discourse-cdn.com/flex021/uploads/rocketchat/original/2X/b/b0704c8c1e4c22a1e08ff5c0e9530e7c9ab5a5ba.png)

this my settings… “INTERNAL SERVER ERROR”
