无法使 XMPP vCard 用户搜索在 Ubuntu 22.04.2 和 LDAP 到 Active Directory 下正常运行版本 21.12-1 ejabberd

无法使 XMPP vCard 用户搜索在 Ubuntu 22.04.2 和 LDAP 到 Active Directory 下正常运行版本 21.12-1 ejabberd

我已经使用 Swift 和 Gajim 进行了测试。AD 身份验证集成有效,但从 Swift 和 Gajim 运行时 vcard 搜索失败,但从命令行运行成功。Gajim 来自 2023 年 6 月 11 日的夜间版本有什么建议吗?

这有效:

root@im:/etc/ejabberd# ejabberdctl get_vcard samsmith localhost FN
Sam Smith

该配置是来自此处文档的原始配置:

https://docs.ejabberd.im/admin/configuration/ldap/#active-directory

Pigdin 可以工作,但是据我所知没有 vcard 搜索功能。如果您输入用户 ID,它可以搜索用户信息,但不能进行通配符搜索

我尝试过的所有其他桌面 XMPP 客户端似乎都很旧,并使用旧的 SSL 加密,无法连接到 ejabberd

以下是相关配置:

auth_method: [ldap]
ldap_servers:
  - "dc1.example.com"
ldap_encrypt: none
ldap_base: "dc=example,dc=com"
ldap_rootdn: 'cn=Administrator,ou="Administrative Accounts",ou="Information Technology",ou=Administration,dc=example,dc=com'
ldap_password: "guessme"
ldap_uids: ["sAMAccountName"]
ldap_filter: "(objectClass=user)"
.
.
.
 mod_stream_mgmt:
    resend_on_timeout: if_offline
  mod_stun_disco: {}

  mod_vcard:
    search: true
    db_type: ldap
    ldap_vcard_map:
      NICKNAME: {"%u": []}
      GIVEN: {"%s": [givenName]}
      MIDDLE: {"%s": [initials]}
      FAMILY: {"%s": [sn]}
      FN: {"%s": [displayName]}
      EMAIL: {"%s": [mail]}
      ORGNAME: {"%s": [company]}
      ORGUNIT: {"%s": [department]}
      CTRY: {"%s": [c]}
      LOCALITY: {"%s": [l]}
      STREET: {"%s": [streetAddress]}
      REGION: {"%s": [st]}
      PCODE: {"%s": [postalCode]}
      TITLE: {"%s": [title]}
      URL: {"%s": [wWWHomePage]}
      DESC: {"%s": [description]}
      TEL: {"%s": [telephoneNumber]}
    ldap_search_fields:
      User: "%u"
      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
      Email: EMAIL


  mod_vcard_xupdate: {}
  mod_version: {}

.
.

Here is the error I get when I try a search from Gajim for Windows clicking Accounts  Discover Services,  vCard User Search  vjud.im.example.com in the /var/log/ejabberd/error.log file

2023-06-11 21:22:27.776738+00:00 [info] <0.566.0>@ejabberd_c2s:bind/2:442 (tls|<0.566.0>) Opened c2s session for [email protected]/gajim.LW3ZEHS3
2023-06-11 21:23:08.430561+00:00 [error] <0.566.0>@gen_iq_handler:process_iq/4:116 Failed to process iq:
#iq{
 id = <<"19500e8f-201c-461d-9021-eb5c2eb30f9d">>,type = set,lang = <<"en">>,
 from =
  #jid{
   user = <<"samsmith">>,server = <<"im.example.com">>,
   resource = <<"gajim.LW3ZEHS3">>,luser = <<"samsmith">>,
   lserver = <<"im.example.com">>,lresource = <<"gajim.LW3ZEHS3">>},
 to =
  #jid{
   user = <<>>,server = <<"vjud.im.example.com">>,resource = <<>>,luser = <<>>,
   lserver = <<"vjud.im.example.com">>,lresource = <<>>},
 sub_els =
  [#xmlel{
    name = <<"query">>,
    attrs = [{<<"xmlns">>,<<"jabber:iq:search">>}],
    children =
     [#xmlel{
       name = <<"x">>,
       attrs = [{<<"xmlns">>,<<"jabber:x:data">>},{<<"type">>,<<"submit">>}],
       children =
        [#xmlel{
          name = <<"title">>,attrs = [],
          children = [{xmlcdata,<<"Search users in vjud.im.example.com">>}]},
         #xmlel{
          name = <<"instructions">>,attrs = [],
          children =
           [{xmlcdata,
             <<"Fill in the form to search for any matching XMPP User (Add * to the end of field to match substring)">>}]},
         #xmlel{        
          name = <<"field">>,
          attrs =
           [{<<"var">>,<<"%u">>},
            {<<"type">>,<<"text-single">>},
            {<<"label">>,<<"User">>}],
          children =
           [#xmlel{
             name = <<"value">>,attrs = [],
             children = [{xmlcdata,<<"samsmith*">>}]}]},
         #xmlel{
          name = <<"field">>,
          attrs =
           [{<<"var">>,<<"givenName">>},
            {<<"type">>,<<"text-single">>},
            {<<"label">>,<<"Name">>}],
          children = []},
         #xmlel{
          name = <<"field">>,
          attrs =
           [{<<"var">>,<<"sn">>},
            {<<"type">>,<<"text-single">>},
            {<<"label">>,<<"Family Name">>}],
          children = []},
         #xmlel{
          name = <<"field">>,
          attrs =
           [{<<"var">>,<<"mail">>},
            {<<"type">>,<<"text-single">>},
            {<<"label">>,<<"Email">>}],
          children = []},
         #xmlel{
          name = <<"field">>,
          attrs =
           [{<<"var">>,<<"company">>},
            {<<"type">>,<<"text-single">>},
            {<<"label">>,<<"Company">>}],
          children = []},
         #xmlel{
          name = <<"field">>,
          attrs =
           [{<<"var">>,<<"department">>},
            {<<"type">>,<<"text-single">>},
            {<<"label">>,<<"Department">>}],
          children = []},
         #xmlel{
          name = <<"field">>,
          attrs =
           [{<<"var">>,<<"title">>},
            {<<"type">>,<<"text-single">>},
            {<<"label">>,<<"Role">>}],
          children = []},
         #xmlel{
          name = <<"field">>,
          attrs =
           [{<<"var">>,<<"description">>},
            {<<"type">>,<<"text-single">>},
            {<<"label">>,<<"Description">>}],
          children = []},
         #xmlel{
          name = <<"field">>,
          attrs =
           [{<<"var">>,<<"telephoneNumber">>},
            {<<"type">>,<<"text-single">>},
            {<<"label">>,<<"Phone">>}],
          children = []}]}]}],
 meta = #{ip => {0,0,0,0,0,65535,44048,65067}}}
** exception error: no function clause matching
                  eldap_utils:'-make_filter/2-fun-1-'({<<"givenName">>,[]}) (eldap_utils.erl, line 114)
   in function  lists:flatmap/2 (lists.erl, line 1254)
   in call from lists:flatmap/2 (lists.erl, line 1254)
   in call from eldap_utils:make_filter/2 (eldap_utils.erl, line 113)
   in call from mod_vcard_ldap:search/4 (mod_vcard_ldap.erl, line 124)
   in call from mod_vcard:search_result/4 (mod_vcard.erl, line 483)
   in call from mod_vcard:process_search/1 (mod_vcard.erl, line 264)
   in call from gen_iq_handler:process_iq/3 (gen_iq_handler.erl, line 131)

相关内容