RocketChat / RocketChat/Rocket.Chat

User's data don't SYNC through LDAP

Open
#26,647 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

LDAP data don't SYNC to RocketChat database
LDAP connection works as expected
LDAP users search works as expected with field 'Search field' -> 'uid'

Steps to reproduce:
  1. Goto 'Settings -> LDAP -> Data sync'
  2. Put 'uid' into 'Unique Identifier Field' field
  3. Press 'Save changes' and 'Sync now'
Expected behavior:

All users from LDAP database copied into RockerChat Users database

Server Setup Information:
  • Version of Rocket.Chat Server: 5.0.2/5.0.3/5.0.4
  • Operating System: Linux ... 5.17.12-300.fc36.x86_64
  • Deployment Method: Docker Compose
  • Number of Running Instances: 1
  • DB Replicaset Oplog: MongoDB 4.4
  • MongoDB Version: 4.4
Relevant logs:

Logs from server container after 'TestLDAP search' pressed (user found well)

{"level":30,"time":"2022-08-22T09:40:42.495Z","pid":1,"hostname":"0c54281d2887","name":"LDAP","section":"Connection","msg":"Connecting","url":"ldaps://<noname_host>:636"}
{"level":20,"time":"2022-08-22T09:40:42.495Z","pid":1,"hostname":"0c54281d2887","name":"LDAP","section":"Connection","msg":"clientOptions","clientOptions":{"url":"ldaps://<noname_host>:636","timeout":60000,"connectTimeout":1000,"idleTimeout":1000,"reconnect":true,"log":{},"tlsOptions":{"rejectUnauthorized":false}}}
{"level":30,"time":"2022-08-22T09:40:42.612Z","pid":1,"hostname":"0c54281d2887","name":"LDAP","section":"Connection","msg":"LDAP connected"}
{"level":20,"time":"2022-08-22T09:40:42.612Z","pid":1,"hostname":"0c54281d2887","name":"LDAP","section":"Connection","clazz":"Client","ldap_id":"21__ldaps://<noname_host>:636","msg":"connected after 1 attempt(s) %j"}
{"level":30,"time":"2022-08-22T09:40:42.613Z","pid":1,"hostname":"0c54281d2887","name":"LDAP","section":"Search","msg":"Searching by username","username":"<noname_user>","baseDN":"cn=users,cn=accounts,dc=ipa","searchOptions":{"filter":"(&(objectclass=)(uid=<noname_user>))","scope":"sub","sizeLimit":1000,"attributes":["","+"],"paged":{"pageSize":250,"pagePause":false}}}
{"level":30,"time":"2022-08-22T09:40:42.614Z","pid":1,"hostname":"0c54281d2887","name":"LDAP","section":"Bind","msg":"Binding UserDN","userDN":"uid=admin,cn=users,cn=accounts,dc=ipa"}
{"level":20,"time":"2022-08-22T09:40:42.655Z","pid":1,"hostname":"0c54281d2887","name":"LDAP","section":"Search","msg":"searchOptions","searchOptions":{"filter":"(&(objectclass=)(uid=<noname_user>))","scope":"sub","sizeLimit":1000,"attributes":["","+"],"paged":{"pageSize":250,"pagePause":false}},"baseDN":"cn=users,cn=accounts,dc=ipa"}
{"level":20,"time":"2022-08-22T09:40:43.114Z","pid":1,"hostname":"0c54281d2887","name":"LDAP","section":"Mapping","msg":"Extracted Attribute","key":"dn","type":"string","value":"uid=<noname_user>,cn=users,cn=accounts,dc=ipa"}
...
{"level":20,"time":"2022-08-22T09:40:43.115Z","pid":1,"hostname":"0c54281d2887","name":"LDAP","section":"Mapping","msg":"Extracted Attribute","key":"uid","type":"string","value":"<noname_user>"}
...

Logs from server container after 'Sync Now' pressed:

{"level":35,"time":"2022-08-22T09:36:05.790Z","pid":1,"hostname":"0c54281d2887","name":"API","method":"POST","url":"/api/v1/method.call/license%3AgetModules","userId":"YQ5ExFNyJpFNxgDbT","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36","length":"96","host":"127.0.0.1:3333","referer":"https://<noname_host>/admin/settings/LDAP","remoteIP":"192.168.32.1","status":200,"responseTime":30}
{"level":35,"time":"2022-08-22T09:36:06.131Z","pid":1,"hostname":"0c54281d2887","name":"API","method":"GET","url":"/api/v1/licenses.get","userId":"YQ5ExFNyJpFNxgDbT","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36","host":"127.0.0.1:3333","referer":"https://<noname_host>/admin/settings/LDAP","remoteIP":"192.168.32.1","status":200,"responseTime":410}
{"level":35,"time":"2022-08-22T09:36:06.136Z","pid":1,"hostname":"0c54281d2887","name":"API","method":"GET","url":"/api/v1/licenses.isEnterprise","userId":"YQ5ExFNyJpFNxgDbT","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36","host":"127.0.0.1:3333","referer":"https://<noname_host>/admin/settings/LDAP","remoteIP":"192.168.32.1","status":200,"responseTime":620}
{"level":35,"time":"2022-08-22T09:36:06.153Z","pid":1,"hostname":"0c54281d2887","name":"API","method":"GET","url":"/api/v1/cloud.registrationStatus","userId":"YQ5ExFNyJpFNxgDbT","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36","host":"127.0.0.1:3333","referer":"https://<noname_host>/admin/settings/LDAP","remoteIP":"192.168.32.1","status":200,"responseTime":360}
{"level":35,"time":"2022-08-22T09:36:06.166Z","pid":1,"hostname":"0c54281d2887","name":"API","method":"POST","url":"/api/v1/ldap.syncNow","userId":"YQ5ExFNyJpFNxgDbT","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36","length":"0","host":"127.0.0.1:3333","referer":"https://<noname_host>/admin/settings/LDAP","remoteIP":"192.168.32.1","status":200,"responseTime":4}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the LDAP Data sync settings and the /api/v1/ldap.syncNow entry point shown in the logs. Reproduce the issue with uid as the Unique Identifier Field and trace why Sync Now does not copy LDAP users into the Rocket.Chat users database; done means the expected users are created or updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.