public
Description: Rails plugin that allows for simple authentication to an LDAP server with a minimum of configuration
Homepage: http://code.jeremyevans.net/doc/simple_ldap_authenticator/
Clone URL: git://github.com/jeremyevans/simple_ldap_authenticator.git
100644 23 lines (19 sloc) 0.808 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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