devise_ldap_authenticatable icon indicating copy to clipboard operation
devise_ldap_authenticatable copied to clipboard

Add psych4 support

Open schlumpfit opened this issue 3 years ago • 5 comments

  • Psych 4 does not load aliases unless aliases: true is provided as an argument
  • Workaround taken from rails: https://github.com/rails/rails/commit/179d0a1f474ada02e0030ac3bd062fc653765dbe

schlumpfit avatar Feb 24 '22 13:02 schlumpfit

Hello will this PR be merged?

aminbs avatar Mar 06 '23 15:03 aminbs

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

spacemunkay avatar Dec 07 '23 18:12 spacemunkay