RocketChat / RocketChat/Rocket.Chat

Ldap sync problem : array fields not casted to string

Open
#8,760 1 comment 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

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

Description

Hi !

Version 0.59.3
I found a bug when a LDAP field is an array of values (several emails for example), values of the array are not casted to string, so items of this attribute stay as Buffer object, in LDAP.prototype.extractLdapEntryData (rocketchat_ldap.js)

I fixed the problem by adding this lines at line 461 of rocketchat_ldap.js

 if(Array.isArray(value)) {
              value = _.map(value, function(v) {
                                        return v instanceof Buffer ? v.toString() : v;
                               });
  }

Best

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.