Skip to content

Instantly share code, notes, and snippets.

@schaary
Created April 11, 2014 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schaary/10450688 to your computer and use it in GitHub Desktop.
Save schaary/10450688 to your computer and use it in GitHub Desktop.
ldap_bind with net-ldap
require 'net/ldap'
ldap = Net::LDAP.new
ldap.host = your_server_ip_address
ldap.port = 389
ldap.auth "joe_user", "opensesame"
if ldap.bind
# authentication succeeded
else
# authentication failed
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment