ldap fluff provides an easy way for your ruby apps to query regular LDAP, FreeIPA and Active Directory systems for authentication and authorization.
It’s currently being used in the Katello Project to provide the auth system with authentication and group membership info
You can easily add ldap fluff to your system, especially if you’re already using devise or something similar, to add additional auth backend support. Here’s how to get started:
1
|
|
You need /etc/ldap_fluff.yml to configure your LDAP connection. An example is provided in the source repo
Here’s an example to connect to my FreeIPA server, named AMERICA
1 2 3 4 5 6 7 8 |
|
The service_user doesn’t have to be admin (and probably shouldn’t be - but I’m no LDAP admin), but just any user that has R/O access to user & group data
Next, fire up irb or your rails console
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Note that the “is in groups?” method is an AND operation. These methods should provide all you need to support read only authorization and authentication based on LDAP and LDAP groups.