processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/ejabberd/
Other
6.11k stars 1.51k forks source link

LDAP Contact Shared #2794

Closed Gadgetroch closed 5 years ago

Gadgetroch commented 5 years ago

Good morning,

I'm trying to get contact by ldap connection. So i use mod_shared_roster_ldap.

mod_roster:
    versioning: true
mod_shared_roster: {}
mod_shared_roster_ldap:
  ldap_base: "cn=Users,dc=PRIVATE,dc=PRIVATE"
  ldap_rfilter: "(objectClass=department)"
  ldap_groupattr: "ou"
  ldap_memberattr: "cn"
  ldap_filter: "(objectClass=department)"
  ldap_userdesc: "displayName"
mod_stats: {}
mod_time: {}
mod_vcard:
  search: false
mod_version: {}

But i see no contact, and i have no error in log.

If you have an idea...

Thank's

Gadgetroch commented 5 years ago

UP ?

cryol commented 5 years ago

Hi, try use this as an example. I have been using FreeIPA with this config for the last five years: config ldap global section:

ldap_servers:
   - "auth.ipa.example.com"
ldap_encrypt: none
ldap_port: 389
ldap_rootdn: "uid=ejabberd,cn=sysaccounts,cn=etc,dc=example,dc=com"
ldap_password: "ldappasswd"
ldap_base: "dc=example,dc=com"
ldap_uids:
   - "uid": "%u"
ldap_filter: "(&(objectClass=inetOrgPerson)(!(nsAccountLock=TRUE))(memberOf=cn=xmpp_users,cn=groups,cn=accounts,dc=example,dc=com))"

config modules section: module mod_roster enabled! it is important

mod_roster: {}
mod_shared_roster_ldap:
  ldap_base: "cn=users,cn=accounts,dc=example,dc=com"
  ldap_rfilter: "(&(objectClass=inetOrgPerson)(!(nsAccountLock=TRUE))(!(memberOf=cn=service_users,cn=groups,cn=accounts,dc=example,dc=com)))"
  ldap_groupattr: "employeeNumber"
  ldap_memberattr: "uid"
  ldap_userdesc: "displayName"

and config vcard:

mod_vcard:
  db_type: ldap
  search: true
  ldap_vcard_map:
    "NICKNAME": {"%u": []}
    "FN": {"%s": ["displayName"]}
    "FAMILY": {"%s": ["sn"]}
    "GIVEN": {"%s": ["givenName"]}
    "ORGNAME": {"%s": ["company"]}
    "ORGUNIT": {"%s": ["department"]}
    "LOCALITY": {"%s": ["l"]}
    "DESC": {"%s": ["description"]}
    "TEL": {"%s": ["mobile"]}
    "EMAIL": {"%s": ["mail"]}
    "PHOTO": {"%s": ["jpegPhoto"]}

  ldap_search_fields:
    "Name": "givenName"
    "Family Name": "sn"
    "Email": "mail"
    "Company": "company"
    "Department": "department"
    "Role": "title"
    "Description": "description"
    "Phone": "telephoneNumber"

  ldap_search_reported:
    "Full Name": "FN"
    "Nickname": "NICKNAME"
    "Birthday": "BDAY"
    "Email": "EMAIL"

Current version ejabberd: 18.12.1 OS: Centos 7.6

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.