You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use lualdap, but it doesn't work for me. My code is as below:
require 'lualdap'
ld = lualdap.open_simple("my-ldap-server", "user", "pass")
if ld == nil then
print("LDAP not connected!")
return 1
end
for dn, attribs in ld:search { base = "dc=mycompany,dc=com" } do
print (string.format ("\t[%s]\n", dn))
for name, values in pairs (attribs) do
io.write ("["..name.."] : ")
if type (values) == "string" then
io.write (values)
elseif type (values) == "table" then
local n = table.getn(values)
for i = 1, (n-1) do
io.write (values[i]..",")
end
io.write (values[n])
end
io.write ("\n")
end
end
ld:close()
print("Done!!")
In the meantime, if I use ldapsearch to do same search:
$ ldapsearch -D user -w pass -h my-ldap-server -b 'dc=mycompany,dc=com'
the ldapsearch command works, returning LDAP records.
Why's wrong with my code?
The text was updated successfully, but these errors were encountered:
I'm trying to use
lualdap
, but it doesn't work for me. My code is as below:In the meantime, if I use
ldapsearch
to do same search:the
ldapsearch
command works, returning LDAP records.Why's wrong with my code?
The text was updated successfully, but these errors were encountered: