使用 OpenLDAP 的 Mac OS X 10.9 服务器身份验证不起作用

使用 OpenLDAP 的 Mac OS X 10.9 服务器身份验证不起作用

我有一台运行 OpenLDAP 版本 2.4.31 的 Debian 服务器,现在我正尝试连接我的 Mac OS X 10.9 服务器,以便可以对现有 LDAP 用户进行身份验证。我使用目录实用程序成功连接了它们,并将用户记录映射到服务器返回的值。我进行了以下映射:

User: inetOrgPerson
    EmailAddress: mail
    FirstName: givenName
    LastName: sn
    Password: userPassword
    PrimaryGroupID: #5000
    RealName: cn
    RecordName: uid
    UniqueID: uidNumber
    GeneratedUID: mail

我可以使用 Directory Utility 和在本地网络上运行的服务(如 Time Machine)成功进行身份验证。但是,当我尝试访问任何可从 Internet 访问的服务(如 Wiki Server 或 Xcode Server)时,身份验证就会失败。这是我尝试登录 Wiki 时来自我的 OS X Server 的日志:

Nov 29 21:06:55 osx.example.org collabd[437]: [CSAuthService.m:315 11d8d000 +269ms] Digest did not validate
Nov 29 21:06:55 osx.example.org collabd[437]: [CSServiceDispatcher.m:260 11d8d000 +0ms] Caught exception "Invalid Credentials" [CSAuthBadDigest] executing [http]Request{AuthService.validateUsernameAndPasswordDigest:remember:(<<scrubbed>>)}

这是我尝试登录 Xcode Server 时的第二条日志:

Nov 29 21:23:27 osx.example.org collabd[437]: [CSAuthService.m:315 11b5a000 +95ms] Digest did not validate
Nov 29 21:23:27 osx.example.org collabd[437]: [CSServiceDispatcher.m:260 11b5a000 +0ms] Caught exception "Invalid Credentials" [CSAuthBadDigest] executing [http]Request{AuthService.sessionForDigest:remember:(Digest username="redacted",realm="osx.example.org",nonce="****",nc="*****",cnonce="***",qop="auth",algorithm=md5-sess,uri="/",response="***",0)}

看起来它正在连接到 LDAP 服务器,但要做什么呢?无论如何,这是 LDAP 日志:

filter: (&(|(objectClass=inetOrgPerson))(|(uid=redacted)(cn=redacted)))
ber_scanf fmt ({M}}) ber:
...
bdb_dn2entry("dc=example,dc=org")
search_candidates: base="dc=example,dc=org" (0x00000001) scope=2
...
5298f51f => send_search_entry: conn 1001 dn="uid=redacted,ou=users,dc=example,dc=org"
ber_flush2: 183 bytes to sd 12
ldap_write: want=183, written=183
...
5298f51f <= send_search_entry: conn 1001 exit.
5298f51f send_ldap_result: conn=1001 op=3 p=3
5298f51f send_ldap_result: err=0 matched="" text=""
5298f51f send_ldap_response: msgid=4 tag=101 err=0
ber_flush2: 14 bytes to sd 12
ldap_write: want=14, written=14
  0000:  30 0c 02 01 04 65 07 0a  01 00 04 00 04 00         0....e........

据我所知,OS X 服务器向 LDAP 服务器请求用户记录,但 OS X 端有些地方出了问题。有人能告诉我该怎么做才能使身份验证成功吗?问题可能是“域”似乎有误吗?ldap 服务器的主机名是“example.org”,但 osx 服务器的主机名是“osx.example.org”。如果域确实是问题所在,我该如何将其从 osx.example.org 更改为 example.org?

答案1

我知道这是一个老问题,但我也遇到了同样的问题,并在旅行中看到了这篇文章。如果它能帮助你(或其他人),并让后人受益,这就是我必须做的来解决这个问题:

在服务器上,打开 WebConfigProperties.plist 文件并将属性 RealmAuthType 从 Digest 更改为 Basic。默认情况下,配置文件应位于 /Library/Server/Web/Config/apache2/。

希望这可以帮助!

相关内容