Skip to content

Commit

Permalink
feat: allow admin bind in ldap
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Sep 4, 2023
1 parent 45ccc3c commit 640489d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,6 @@
# ==> Devise secret key
# Secret key to be used by devise in prod.
config.secret_key = Doubtfire::Application.secrets.secret_key_devise if Rails.env.production?

config.ldap_use_admin_to_bind = ENV.fetch('DF_LDAP_USE_ADMIN_TO_BIND', 'false').to_s.downcase != 'false'
end
12 changes: 9 additions & 3 deletions config/ldap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@ development:
port: <%= ENV['DF_LDAP_PORT'] %>
attribute: <%= ENV['DF_LDAP_ATTRIBUTE'] %>
base: <%= ENV['DF_LDAP_BASE'] %>
ssl: false
admin_user: <%= ENV['DF_LDAP_ADMIN_USER'] %>
admin_password: <%= ENV['DF_LDAP_ADMIN_PWD'] %>
ssl: <%= ENV['DF_LDAP_SSL'].to_s.downcase != "false" %>

test:
host: <%= ENV['DF_LDAP_HOST'] %>
port: <%= ENV['DF_LDAP_PORT'] %>
attribute: <%= ENV['DF_LDAP_ATTRIBUTE'] %>
base: <%= ENV['DF_LDAP_BASE'] %>
ssl: false
admin_user: <%= ENV['DF_LDAP_ADMIN_USER'] %>
admin_password: <%= ENV['DF_LDAP_ADMIN_PWD'] %>
ssl: <%= ENV['DF_LDAP_SSL'].to_s.downcase != "false" %>

production:
host: <%= ENV['DF_LDAP_HOST'] %>
port: <%= ENV['DF_LDAP_PORT'] %>
attribute: <%= ENV['DF_LDAP_ATTRIBUTE'] %>
base: <%= ENV['DF_LDAP_BASE'] %>
ssl: false
admin_user: <%= ENV['DF_LDAP_ADMIN_USER'] %>
admin_password: <%= ENV['DF_LDAP_ADMIN_PWD'] %>
ssl: <%= ENV['DF_LDAP_SSL'].to_s.downcase != "false" %>

0 comments on commit 640489d

Please sign in to comment.