我目前正在为我的企业中的用户实现LDAP登录。
require 'net/ldap'
ldap = Net::LDAP.new(:host => '10.0.0.32', :port => 389)
if ldap.bind(:method => :simple, :username => "ttyler",
:password => "********")
# authentication succeeded
else
# authentication failed
p ldap.get_operation_result
end这段代码正在运行,但是我得到了下面的错误。
#<OpenStruct extended_response=nil, code=49, error_message="80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db1\u0000", matched_dn="", message="Invalid Credentials">我当前的机器在我的业务所属的域上,我执行了一个nslookup以确保主机是正确的-它是正确的。我知道我的证书没有错,因为我每天都在使用它们。有人知道为什么会发生这种情况吗?
我也尝试了域名的名称,即********.local,但这不起作用。还有其他想法吗?
发布于 2017-07-21 02:52:05
您需要在域名中指定:base属性。f.e.如果你的域名是example.local,那么你的基础就是"dc=example,dc=com“。
您还需要在目录中指定用户的完整路径。f.e.服务器管理员通常是"cn=admin,dc=example,dc=local“。
通常在用户ou中找到常规用户,例如:"cn=ttyler,ou=Users,dc=example,dc=com“。
https://stackoverflow.com/questions/45215780
复制相似问题