Rocket.chat: Import LDAP/AD fields into customFields and display on User Info

Created on 6 Jun 2019  ยท  7Comments  ยท  Source: RocketChat/Rocket.Chat

Description:

Desire to show custom fields on user info. User's are created by LDAP, no local logins allowed

Steps to reproduce:

  1. Go to Admin - Accounts - Custom Fields to Show in User Info

  2. Enter field as [{"telephoneNumber":"#{telephoneNumber}"}, {"siteLocation":"#{siteLocation}"}]
    telephoneNumber and siteLocation are valid attributes in our Active Directory

  3. Go to Admin - LDAP - Sync/Import
    Enter in the User Data Field Map to include telephoneNumber and siteLocation
    {"cn":"name", "mail":"email", "telephoneNumber":"customFields.telephoneNumber"}

  4. Not sure if it is required since registration is disabled on our rocketchat instance but created the custom fields entries under Admin - Accounts - Registration
    {
    โ€ƒ"telephoneNumber": {
    โ€ƒโ€ƒ"type": "text",
    โ€ƒโ€ƒ"required": true,
    โ€ƒโ€ƒ"minLength": 4,
    โ€ƒโ€ƒ"maxLength": 12
    โ€ƒ}
    โ€ƒ"siteLocation": {
    โ€ƒโ€ƒ"type": "text",
    โ€ƒโ€ƒ"required": true,
    โ€ƒโ€ƒ"minLength": 4,
    โ€ƒโ€ƒ"maxLength": 10
    โ€ƒ}
    }

Expected behavior:

That the customfield info would show up when I click the User Info and it would sync that information from Active Directory

Actual behavior:

No new fields show up under User Info

Server Setup Information:

  • Version of Rocket.Chat Server: 1.1.1
  • Operating System: CentOS Linux release 7.6.1810 (Core)
  • Deployment Method: tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog: enabled
  • NodeJS Version: 8.11.3
  • MongoDB Version: 3.6.12

Additional context

The format/syntax could be incorrect, there doesn't appear to be official documentation for the format these fields are expecting. I pieced together what I entered from other issues that had been reported but none of the issues I saw appears to put all the information together in a single place and so I am making this bug report.
The overall goal is to have the specific fields that exist in Active Directory displayed on the User Info section so that our employees can quickly reference others phone numbers and seating location.

Most helpful comment

I finally got this to work after reading many other threads, there isn't any official documents that I believe list all of this so hopefully this helps someone else.
Currently on Version 3.4.2

Administration Settings - Accounts

Under Custom Fields to Show in User Info
[{"Phone": "phone"}, {"Location": "seat"}]

Under Registration Section
Custom Fields
{"phone":{"type":"text","required":true,"public":true}, "seat":{"type":"text","required":true,"public":true}}
This is the field that gave the all the issues, I read a comment that this field doesn't like spaces but only tabs, I removed all spaces except the one separating the unique items after the , and it worked perfectly. I suggest do not us spaced in the Custom Fields section to avoid this issue.

Administration Settings - LDAP

Under User Data Field Map
{"cn":"name", "mail":"email", "telephoneNumber":"customFields.phone", "siteLocation":"customFields.seat"}

I did a manual perform sync now and the fields populated instantly.
I really hope this helps others out there and it would be nice to get more details in the documentation on how to set this up, the developers seem to only do this from a high level. Another suggestion would be to allow data type HTML so that I can make the data that is pulled in a clickable URL. That way for siteLocation for example I could click the URL to open our corporate campus map.

All 7 comments

Our rocket chat also doesn't work custom field with AD.

Just checking in on this bug if there has been any updates to help. Currently running rocketchat 2.0.0

Following up on this bug request again to see if we can't a status update. I am now on version 3.0.2 and customer fields still do not display in the user info area.
Thanks

I finally got this to work after reading many other threads, there isn't any official documents that I believe list all of this so hopefully this helps someone else.
Currently on Version 3.4.2

Administration Settings - Accounts

Under Custom Fields to Show in User Info
[{"Phone": "phone"}, {"Location": "seat"}]

Under Registration Section
Custom Fields
{"phone":{"type":"text","required":true,"public":true}, "seat":{"type":"text","required":true,"public":true}}
This is the field that gave the all the issues, I read a comment that this field doesn't like spaces but only tabs, I removed all spaces except the one separating the unique items after the , and it worked perfectly. I suggest do not us spaced in the Custom Fields section to avoid this issue.

Administration Settings - LDAP

Under User Data Field Map
{"cn":"name", "mail":"email", "telephoneNumber":"customFields.phone", "siteLocation":"customFields.seat"}

I did a manual perform sync now and the fields populated instantly.
I really hope this helps others out there and it would be nice to get more details in the documentation on how to set this up, the developers seem to only do this from a high level. Another suggestion would be to allow data type HTML so that I can make the data that is pulled in a clickable URL. That way for siteLocation for example I could click the URL to open our corporate campus map.

I finally got this to work after reading many other threads, there isn't any official documents that I believe list all of this so hopefully this helps someone else.
Currently on Version 3.4.2

Administration Settings - Accounts

Under Custom Fields to Show in User Info
[{"Phone": "phone"}, {"Location": "seat"}]

Under Registration Section
Custom Fields
{"phone":{"type":"text","required":true,"public":true}, "seat":{"type":"text","required":true,"public":true}}
This is the field that gave the all the issues, I read a comment that this field doesn't like spaces but only tabs, I removed all spaces except the one separating the unique items after the , and it worked perfectly. I suggest do not us spaced in the Custom Fields section to avoid this issue.

Administration Settings - LDAP

Under User Data Field Map
{"cn":"name", "mail":"email", "telephoneNumber":"customFields.phone", "siteLocation":"customFields.seat"}

I did a manual perform sync now and the fields populated instantly.
I really hope this helps others out there and it would be nice to get more details in the documentation on how to set this up, the developers seem to only do this from a high level. Another suggestion would be to allow data type HTML so that I can make the data that is pulled in a clickable URL. That way for siteLocation for example I could click the URL to open our corporate campus map.

Thank you, m8! You are my hero.

:

It looks like it works only for recent imported users tho. For existing ones, it's not populating the field, at least not for me...

any other versions?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  ยท  3Comments

Buzzele picture Buzzele  ยท  3Comments

royalaid picture royalaid  ยท  3Comments

mddvul22 picture mddvul22  ยท  3Comments

amayer5125 picture amayer5125  ยท  3Comments