Commit b5716f710d0eb36eb65023d205ea80c166b018a6
1 parent
a844dead
Exists in
master
and in
1 other branch
Trimmed down my LDAP howto. Most people wont need this.
Showing
1 changed file
with
7 additions
and
21 deletions
Show diff stats
README.md
| @@ -100,29 +100,15 @@ for you. Checkout [Hoptoad](http://hoptoadapp.com) from the guys over at | @@ -100,29 +100,15 @@ for you. Checkout [Hoptoad](http://hoptoadapp.com) from the guys over at | ||
| 100 | 100 | ||
| 101 | **Configuring LDAP authentication:** | 101 | **Configuring LDAP authentication:** |
| 102 | 102 | ||
| 103 | - 1. Add the following line to Errbit's Gemfile: | 103 | +Follow the instructions at https://github.com/cschiewek/devise_ldap_authenticatable |
| 104 | 104 | ||
| 105 | - gem "devise_ldap_authenticatable", :git => "git://github.com/cschiewek/devise_ldap_authenticatable.git" | 105 | +If you want to authenticate via `username`, add the following lines to `app/models/user.rb`: |
| 106 | 106 | ||
| 107 | - 2. Install new dependencies | ||
| 108 | - | ||
| 109 | - bundle install | ||
| 110 | - | ||
| 111 | - 3. Run the rails generator for `devise_ldap_authenticatable` | ||
| 112 | - | ||
| 113 | - rails generate devise_ldap_authenticatable:install --advanced | ||
| 114 | - | ||
| 115 | - 4. Configure your LDAP settings in `config/initializers/devise.rb`. | ||
| 116 | - | ||
| 117 | - 5. If you want to authenticate via `username`, then add the following lines to `app/models/user.rb`: | ||
| 118 | - | ||
| 119 | - field :username | ||
| 120 | - before_save :set_ldap_email | ||
| 121 | - def set_ldap_email | ||
| 122 | - self.email = Devise::LdapAdapter.get_ldap_param(self.username, "mail") | ||
| 123 | - end | ||
| 124 | - | ||
| 125 | -To learn more, please follow the instructions at https://github.com/cschiewek/devise_ldap_authenticatable | 107 | + field :username |
| 108 | + before_save :set_ldap_email | ||
| 109 | + def set_ldap_email | ||
| 110 | + self.email = Devise::LdapAdapter.get_ldap_param(self.username, "mail") | ||
| 111 | + end | ||
| 126 | 112 | ||
| 127 | 113 | ||
| 128 | Upgrading | 114 | Upgrading |