Skip to content

Instantly share code, notes, and snippets.

@vpereira
Created June 20, 2011 16:59
Show Gist options
  • Save vpereira/1035997 to your computer and use it in GitHub Desktop.
Save vpereira/1035997 to your computer and use it in GitHub Desktop.
simpleBind with ruby
require 'rubygems'
require 'ldap' #gem ruby-ldap
conn = LDAP::Conn.new('localhost', 389)
conn.set_option(LDAP::LDAP_OPT_PROTOCOL_VERSION,3)
r = conn.bind "cn=bigshot,dc=test,dc=com","opensesame"
puts r.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment