Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rails plugin that allows for simple authentication to an LDAP server with a minimum of configuration
branch: master

Fix issue where an empty password would be interpreted as an anonymou…

…s bind

If anonymous binds were allowed on the LDAP server and an empty
password was used, valid? would return true.  This is a very
serious bug, and the only two workarounds are to disable
anonymous binds in ldap or disallow empty passwords completely.
As this library has no control over the server, I chose to
disallow empty passwords completely.

Bump version to 1.0.1.
latest commit add9f7108d
Jeremy Evans authored

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
Something went wrong with that request. Please try again.