【发布时间】:2018-06-03 00:56:19
【问题描述】:
尝试使用现有的 user_dn 和 userPassword 绑定到 LDAP 服务器时,即使 userPassword 不正确,我也没有足够的访问权限。如果我输入不正确的 user_dn,我会得到无效的凭据。
为什么会出现这些错误?这些错误的含义是什么?我应该如何修复它们?
这是我用来绑定的代码
require 'net/ldap'
con = Net::LDAP.new
con.host = 'localhost'
con.port = 389
con.auth 'cn=user,dc=example,dc=com', 'user'
if con.bind
# authentication succeeded
puts 'success'
puts con.get_operation_result
else
# authentication failed
puts 'fail'
puts con.get_operation_result
# p con.get_operation_result
end
提前致谢
【问题讨论】:
标签: ruby ldap openldap ldap-query