Anyone has done work with Ruby-Ldap? and maybe could provide some
examples? I have to admit that I am rather lost using this.
I am looking to do a Rails interface to manage LDAP servers but I can’t
seem to find how to do this in Ruby and for example retrieve the
elements, attributes, and change them.
This is what I have done so far…
#!/appl/ruby/bin/ruby -w
require ‘ldap’
conn = LDAP::Conn.new( ‘ldapserver’, 389 )
conn.set_option( LDAP::LDAP_OPT_PROTOCOL_VERSION, 3 )
res=conn.bind(‘cn=Manager,dc=domain,dc=com’,‘password’)
printf(“connected %s”,res)
conn.search(‘ou=people,dc=domain,dc=com’,LDAP::LDAP_SCOPE_SUBTREE,‘cn=*’,[‘cn’])
do |entry|
dn=entry.get_dn
printf(“dn: %s\n”,dn)
end
How could I get then the details of an entry, and modify them?
Any help would be greatly appreciated.
Stephane
I’ve been using the new Net::Ldap which has pretty good documentation.
The documentation is included with the source.
http://rubyforge.org/projects/net-ldap/
Hi,
Have a look at Enterprise Integration with Ruby [http://
pragmaticprogrammer.com/titles/fr_eir/index.html]. It dedicates about
27 pages to the topic, and it discusses some of the libraries that
have been mentioned in other replies. One of the free excerpts is
even from the LDAP chapter!
Regards,
Craig
On 5/19/06, Stephane Fourdrinier - Fusemail [email protected]
wrote:
Anyone has done work with Ruby-Ldap? and maybe could provide some
examples? I have to admit that I am rather lost using this.
I am looking to do a Rails interface to manage LDAP servers but I can’t
seem to find how to do this in Ruby and for example retrieve the
elements, attributes, and change them.
You might look at ActiveLDAP, an ActiveRecord like layer on top of the
ruby ldap libs.
http://rubyforge.org/projects/ruby-activeldap/
http://wiki.rubyonrails.com/rails/pages/ActiveLDAP
cheers,
jh
–
James H.
Web application developer
Vancouver, BC
“Developing a coherent political analysis is in many respects
contingent upon an ability to connect one context to another, a
process not dissimilar to playing the kid’s game of dot-to-dot.”
- Ward Churchill, from ‘“A Government of Laws”?’