title: Rails authentication with LDAP and local database
body: <p>I am trying to rewrite an older app that was created with PHP/MySQL.
  The authentication system used has a users table in the database that stores username, email etc... but NOT passwords. </p>
  
  <p>Whenever the user logs in it first checks the database to see if the user exists if not then returns a login error. If the user exists in the local database then it tries to bind to the active directory using the username/password combination entered by the user and creates a session if successful.</p>
  
  <p>What is the best way to accomplish this using Rails?</p>