Here is the code:

------------------------------------------

require 'ldap'
require 'base64'
require 'digest/md5'

  pass = "{MD5}" + Base64.encode64(Digest::MD5.digest("secret") ).chomp
#  pass='secret'
  conn = LDAP::Conn.new( 'dc.domain.com', 389 )
  conn.set_option( LDAP::LDAP_OPT_PROTOCOL_VERSION, 3 )
  conn.bind('admin / domain.com',pass)

---------------------------------------------

The problem is it doesn't work with MD5 hashed password but it works
with the plain text password ('secret'). I really appreciate it if
somebody can help me out.

James
-- 
Posted via http://www.ruby-forum.com/.