Simple authentication for Ruby using LDAP
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore Ignore gem files Mar 22, 2015
LICENSE
README
Rakefile Add support for hanna rdoc template, and .gitignore file Nov 4, 2008
simple_ldap_authenticator.gemspec Fix issue where an empty password would be interpreted as an anonymou… Aug 3, 2011

README

SimpleLdapAuthenticator
=======================

Allows for simple authentication to an LDAP server with a minimum of
configuration.  Requires either Ruby/LDAP or Net::LDAP.   

Usage is fairly simple:
  require 'simple_ldap_authenticator'
  SimpleLdapAuthenticator.servers = %w'dc1.domain.com dc2.domain.com'
  SimpleLdapAuthenticator.use_ssl = true
  SimpleLdapAuthenticator.login_format = '%s @domain.com'
  SimpleLdapAuthenticator.logger = RAILS_DEFAULT_LOGGER
  class LoginController < ApplicationController
    def login
      return redirect_to(:action=>'try_again') unless \
        SimpleLdapAuthenticator.valid?(params[:username], \
        params[:password])  
      session[:username] = params[:username]
    end
  end

github: http://github.com/jeremyevans/simple_ldap_authenticator/tree/master