An authentication method using LDAP for [Project Jellyfish] (https://github.com/projectjellyfish/api).
https://rubygems.org/gems/jellyfish-ldapauth
Include in Gemfile:
gem 'jellyfish-ldapauth', git: 'https://github.com/projectjellyfish/jellyfish-ldapauth'
Run the migration:
rails generate jellyfish_ldapauth
rake db:migrate
Add settings to your .env file:
LDAP_TITLE = "Jellyfish LDAP Authentication"
LDAP_HOST = ldap.company.com
LDAP_PORT = 10636
# Can be plain or ssl
LDAP_METHOD = ssl
LDAP_BASE = ou=Users,o=organization_id,dc=company,dc=com
LDAP_UID = uid
LDAP_BIND_DN = uid=username,ou=Admins,o=organization_id,dc=company,dc=com
LDAP_PASSWORD = password
# Can use name proc or filter, both are optional
LDAP_NAME_PROC = "Proc.new {|name| name.gsub(/@.*$/,'')}"
LDAP_FILTER = (&(uid=%{username})(memberOf=cn=myapp-users,ou=groups,dc=example,dc=com))
After checking out the repo, run bin/setup
to install dependencies. Then, run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
to create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
- Fork it ( https://github.com/[my-github-username]/jellyfish-ldapauth/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request