OverviewActive Authentication is a modified version of acts_as_authentication designed to authenticate users against Active Directory and automatically adds them to the database. InstallationInstallation is similar to acts_as_authenticated, first you install the plugin: ./script/plugin install http://activeauthentication.googlecode.com/svn/trunk/activeauthentication Next generate your model and migrate the database: ./script/generate authenticated user account
rake db:migrate Now include the authenticated system in your application.rb file: include AuthenticatedSystem Add a filter to any controller you want to protect: before_filter :login_required And finally, modify config/active_directory.yml to match your environment. TroubleshootingIf you are experiencing problems such as MissingSourceFile (no such file to load -- ldap):
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'
.//app/controllers/account_controller.rb:2You may need to install the ruby ldap libraries. On Ubuntu that can be accomplished with the following command: sudo apt-get install libldap-ruby1.8 FedoraFor those of you using Fedora, Geoffrey Gouez has the following advice (Thanks Geoffrey!): For fedora 7 (and maybe core 5 and 6), using activeauthentication throws missing file exception. This files are include in previous version of openssl rpm and are replaced by .so.6 For resolve problem, just links files in /lib directory like this : ln /lib/libcrypto.so.6 /lib/libcrypto.so.5 ln /lib/libssl.so.6 /lib/libssl.so.5
|