devise_ldap_authenticatable
devise_ldap_authenticatable copied to clipboard
Add psych4 support
- Psych 4 does not load aliases unless
aliases: trueis provided as an argument - Workaround taken from rails: https://github.com/rails/rails/commit/179d0a1f474ada02e0030ac3bd062fc653765dbe
Hello will this PR be merged?
While waiting for this to merge and release, one can meanwhile set the ldap_config to a proc in the Devise initializer:
#/config/initializers/devise.rb
Devise.setup do |config|
config.ldap_config = Proc.new do
YAML.load(ERB.new(File.read("#{Rails.root}/config/ldap.yml")).result, aliases: true)[Rails.env]
end
end
See: https://github.com/cschiewek/devise_ldap_authenticatable/blob/6ef2131e79ff3421429f8d1b0645c6e113db4dc7/lib/devise_ldap_authenticatable/ldap/connection.rb#L7