D
Dick Davies
Can anyone tell me where I'm going wrong here?
I'm trying to write a very simple ldap authenticator, which does
get user and pass
open connection to server
bind anonymously
map the user to a dn
bind as dn and pass <- this goes boom
when I rebind I get an error. Here's a cut down version:
$ irb -r ldap
irb(main):001:0> conn = LDAP::SSLConn.new('ldap.server',389,true)
=> #<LDAP::SSLConn:0x812ec70>
irb(main):002:0> a = conn.bind
=> #<LDAP::SSLConn:0x812ec70>
irb(main):003:0> a.unbind
=> nil
irb(main):004:0> b = conn.bind
LDAP::InvalidDataError: The LDAP handler is already unbind()'ed.
from (irb):4:in `bind'
from (irb):4
if I omit the unbind(), I get 'The LDAP handler is already binded'
That's some catch, that catch 22....
I'm trying to write a very simple ldap authenticator, which does
get user and pass
open connection to server
bind anonymously
map the user to a dn
bind as dn and pass <- this goes boom
when I rebind I get an error. Here's a cut down version:
$ irb -r ldap
irb(main):001:0> conn = LDAP::SSLConn.new('ldap.server',389,true)
=> #<LDAP::SSLConn:0x812ec70>
irb(main):002:0> a = conn.bind
=> #<LDAP::SSLConn:0x812ec70>
irb(main):003:0> a.unbind
=> nil
irb(main):004:0> b = conn.bind
LDAP::InvalidDataError: The LDAP handler is already unbind()'ed.
from (irb):4:in `bind'
from (irb):4
if I omit the unbind(), I get 'The LDAP handler is already binded'
That's some catch, that catch 22....