【问题标题】:Drupal 7 and LDAP authentication with Active Directory使用 Active Directory 的 Drupal 7 和 LDAP 身份验证
【发布时间】:2013-09-03 01:31:41
【问题描述】:

我正在使用 Drupal 7 ldap 模块 (http://drupal.org/project/ldap) 通过 Windows Active Directory 进行身份验证。我收到以下错误:

username : Beginning authentification....
username : Existing Drupal User Account not found. Continuing on to attempt ldap authentication
username : Trying server global_directory where bind_method = 2
username : Success at connecting to global_directory
ldap_search() call: base_dn: CN=Configuration,DC=ab,DC=cd,DC=ef, filter = (samaccountname=username), attributes: , attrsonly = 0, sizelimit = 0, timelimit = 0, deref = , scope = 3
username : Trying server global_directory where bind_method = 2. Error: Success
username : Authentication result id=0 auth_result=3 (Sorry, unrecognized username or password.)
username : Failed ldap authentication. User may have authenticated successfully by other means in a mixed authentication site. LDAP Authentication Error #: 3 error message: Sorry, unrecognized username or password.
Login attempt failed for username.

设置:

sid = global_directory
numeric_sid = 1
name = Global Directory
status = 1
ldap_type = ad
address = ldaps://ldap.url
port = 3269
tls = 0
followrefs = 0
bind_method = 2
basedn = Array ( [0] => CN=Configuration,DC=ab,DC=cd,DC=ef )
binddn = 
user_dn_expression = %username@domain.com
user_attr = samaccountname
account_name_attr =
mail_attr = mail
mail_template =
picture_attr =
unique_persistent_attr =
unique_persistent_attr_binary = 0
ldap_to_drupal_user =
testing_drupal_username =
testing_drupal_user_dn =
grp_unused = 1
grp_object_cat =
grp_nested = 0
grp_user_memb_attr_exists = 0
grp_user_memb_attr =
grp_memb_attr =
grp_memb_attr_match_user_attr =
grp_derive_from_dn = 0
grp_derive_from_dn_attr =
grp_test_grp_dn =
grp_test_grp_dn_writeable =
search_pagination = 0
search_page_size = 1000

如果我将 BaseDN 更改为 DC=cd,DC=ef 错误将是:

username : Beginning authentification....
username : Existing Drupal User Account not found. Continuing on to attempt ldap authentication
username : Trying server global_directory where bind_method = 2
username : Success at connecting to global_directory
ldap_search() call: base_dn: DC=cd,DC=ef, filter = (samaccountname=username), attributes: , attrsonly = 0, sizelimit = 0, timelimit = 0, deref = , scope = 3
ldap_search() function error. LDAP Error: Referral, ldap_search() parameters: ldap_search() call: base_dn: DC=cd,DC=ef, filter = (samaccountname=username), attributes: , attrsonly = 0, sizelimit = 0, timelimit = 0, deref = , scope = 3
username : Trying server global_directory where bind_method = 2. Error: Referral
username : Authentication result id=0 auth_result=8 (Authentication Server or Configuration Error.)
username : Failed ldap authentication. User may have authenticated successfully by other means in a mixed authentication site. LDAP Authentication Error #: 8 error message: Authentication Server or Configuration Error.
Login attempt failed for username.

注意:我使用drupal ldap-7.x-2.0-beta5+24-dev

有人遇到同样的问题吗?任何帮助将不胜感激。

【问题讨论】:

    标签: drupal drupal-7 active-directory ldap


    【解决方案1】:

    我终于找到了一个魔法: 我必须在 LDAP 服务器字段中写入:ldaps://ldap.url:3269,并在 LDAP 端口字段中保持相同的端口号。

    【讨论】:

      【解决方案2】:

      您的问题显然是 baseDN。在第一个错误时,身份验证失败(登录名或密码错误)。至于第二个,你的配置还有一些问题。

      你检查过一切吗?启用 iptables 中的端口?因为它在尝试与服务器联系时似乎失败了(bind_method;身份验证服务器或配置错误)。

      我希望这至少有助于澄清情况:)

      【讨论】:

      • 谢谢@MPrazz,现在问题已经解决了。罪魁祸首是 ldap 服务器安全和端口问题。我必须将 ldap 地址更改为:ldap.url(没有:ldaps://)和端口更改为 3268
      • @Borot,请将问题标记为已解决:) 当然,如果有用,请接受答案:)
      • 其实,如果我想通过 3269 端口的 ssl 连接到 ldap 服务器,仍然存在问题。以前的解决方案在某种程度上不是连接到 AD 的安全方式,这只是一个临时解决方案。 PHP ldap 库或服务器证书应该有什么问题吗?
      • 有可能.. 我建议看看这个网站tutorial。如果你环顾四周,他们还有一篇关于如何通过 ssl 测试 ldap 连接的文章。可能会帮助您找出问题所在:)
      • 谢谢@MPrazz,我已经尝试了许多可能的证书文件方法.. 但它仍然不起作用。我终于找到了一个魔法:我必须在 Ldap Server 字段中写:ldaps://ldap.url:3269
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-11
      • 1970-01-01
      • 2020-04-08
      • 2012-09-02
      • 1970-01-01
      相关资源
      最近更新 更多