OpenLDAP SASL 身份验证

OpenLDAP SASL Authentication

我正在通过 OpenLDAP 设置此身份验证:

OpenLDAP -> 直通(外部身份验证)-> SASL -> PAM -> RSA 代理

为了通过 RSA 令牌访问应用程序。

从下到上:

这是我的 PAM 配置:

#%PAM-1.0
auth required pam_securid.so
account      sufficient pam_ldap.so
account    include      password-auth
password      sufficient pam_ldap.so
password   include      password-auth

这个测试效果很好:

[root@ldap ~]# testsaslauthd -u goingsolo -p 11111111
0: OK "Success."

OpenLdap 已正确配置为使用 PLAIN 中的 SASL Authenticatino:

[root@ldap /]# ldapsearch -h localhost -b "" -LLL -s base supportedSASLMechanisms -x
dn:
supportedSASLMechanisms: PLAIN

并且我的 goingsolo 用户的 userPassword 配置为 {SASL}goingsolo 如果我执行 SASL 绑定,它会起作用:

[root@datap-keldap-1-n01 /]# ldapsearch -h localhost -b dc=ldap,dc=com -U "goingsolo" -w 11111111                  
SASL/PLAIN authentication started
0: OK "Success."

问题是当我使用 -D 而不是 -U 执行简单绑定时,我收到了无效的凭据:

[root@datap-keldap-1-n01 /]# ldapsearch -h localhost -b dc=ldap,dc=com -D "cn=goingsolo,ou=People,dc=ldap,dc=com" -w 11111111                  
ldap_bind: Invalid credentials (49)

此外,当使用完整的 dn 执行 sasl 绑定时,身份验证失败,因为来自 /var/lag/messages:

Mar 27 19:01:00 ldap saslauthd[11777]: do_auth         : auth failure: [user=cn=goingsolo,ou=People,dc=ldap,dc=com] [service=ldap] [realm=] [mech=pam] [reason=PAM auth error]

我想这是因为它没有将完整的 dn 转换为简单用户 (goingsolo)。

关于我应该检查什么的任何提示?

问题是 OpenLdap 是如何构建的(我猜是错误的编译)。我尝试重新安装它,然后它起作用了。确保 SASL 机制设置为普通。