
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
charanya-devise_ldap_authenticatable
Advanced tools
Modifications done to Devise LDAP Authenticatable gem to cater to the needs of my application. Test Application is not yet been updated.It is based on the original version of the gem.
Devise LDAP Authenticatable is a LDAP based authentication strategy for the Devise authentication framework.
If you are building applications for use within your organization which require authentication and you want to use LDAP, this plugin is for you.
For a screencast with an example application, please visit: http://random-rails.blogspot.com/2010/07/ldap-authentication-with-devise.html
Please Note
If you are using rails 2.x then use 0.1.x series of gem, and see the rails2 branch README for instructions.
These gems are dependencies of the gem:
Please Note
This will only work for Rails 3 applications.
In the Gemfile for your application:
gem "devise"
gem "charanya-devise_ldap_authenticatable"
Run the rails generators for devise (please check the devise documents for further instructions)
rails generate devise:install
rails generate devise MODEL_NAME
Run the rails generator for devise_ldap_authenticatable
rails generate devise_ldap_authenticatable:install [options]
This will install the sample.yml, update the devise.rb initializer, and update your user model. There are some options you can pass to it:
Options:
[--user-model=USER_MODEL] # Model to update
# Default: user
[--update-model] # Update model to change from database_authenticatable to ldap_authenticatable
# Default: true
[--add-rescue] # Update Application Controller with resuce_from for DeviseLdapAuthenticatable::LdapException
# Default: true
[--advanced] # Add advanced config options to the devise initializer
Devise LDAP Authenticatable works in replacement of Database Authenticatable
Please Note
This devise plugin has not been tested with DatabaseAuthenticatable enabled at the same time. This is meant as a drop in replacement for DatabaseAuthenticatable allowing for a semi single sign on approach.
The field that is used for logins is the first key that's configured in the config/devise.rb
file under config.authentication_keys
, which by default is email. For help changing this, please see the Railscast that goes through how to customize Devise.
In initializer config/initializers/devise.rb
:
ldap_logger (default: true)
ldap_create_user (default: false)
ldap_config (default: #{Rails.root}/config/ldap.yml)
ldap_update_password (default: true)
ldap_check_group_membership (default: false)
ldap_check_attributes (default: false)
ldap_use_admin_to_bind (default: false)
These parameters will be added to config/initializers/devise.rb
when you pass the --advanced
switch to the generator:
Proc.new() {|attribute, login, ldap| "#{attribute}=#{login},#{ldap.base}" }
)
The Test Application belongs to the original version of the Gem. Not Tested with the modifications done.
This has been tested using the following setup:
All unit and functional tests are part of a sample rails application under test/rails_app and requires a working LDAP sever.
Make sure that directories test/ldap/openldap-data and test/ldap/openldap-data/run exist.
./run_server.sh
ldapadd -x -h localhost -p 3389 -x -D "cn=admin,dc=test,dc=com" -w secret -f base.ldif
* this creates the users / passwords:
rake
For a LDAP server running SSL
./run_server.sh --ssl
ldapadd -x -H ldaps://localhost:3389 -x -D "cn=admin,dc=test,dc=com" -w secret -f base.ldif
* this creates the users / passwords:
LDAP_SSL=true rake
Please Note
In your system LDAP config file (on OSX it's /etc/openldap/ldap.conf) make sure you have the following setting:
TLS_REQCERT never
This will allow requests to go to the test LDAP server without being signed by a trusted root (it uses a self-signed cert)
View on Pivotal Tracker.
Released under the MIT license
Copyright (c) 2010 Curtis Schiewek, Daniel McNevin
FAQs
Unknown package
We found that charanya-devise_ldap_authenticatable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.