plataformatec/devise — Issue #1549: token_authenticatable breaking ldap_authentication in ~>1.5
Author: dalton
Created: 2012-01-04 17:59:01+00:00
State: open

Using 1.4.9, we had the following setup that worked

devise :ldap_authenticatable, :rememberable, :trackable, :token_authenticatable, :authentication_keys => [ :username, :authentication_token ]

When we update to any 1.5 version, ldap_authenticatable no longer passes the validity check for winning strategies in warden.

I _believe_ have narrowed it down to Devise::Strategies::Authenticatable#parse_authentication_key_values, which returns false for our configuration.

# Parse authentication keys considering if they should be enforced or not.
def parse_authentication_key_values(hash, keys)
keys.each do |key, enforce|
value = hash[key].presence
if value
self.authentication_hash[key] = value
else
return false unless enforce == false
end
end
true
end