Authlogic Multiple Password Validation
Posted
by Hock
on Stack Overflow
See other posts from Stack Overflow
or by Hock
Published on 2010-03-22T06:00:54Z
Indexed on
2010/03/22
6:11 UTC
Read the original article
Hit count: 380
Hello, I'm using Authlogic to manage my user sessions. I'm using the LDAP add-on, so I have the following in my users model
acts_as_authentic do |c|
c.validate_password_field = false
end
The problem is that recently I found out that there will be some users inside the application that won't be part of the LDAP (and can't be added!). So I would need to validate SOME passwords against the database and the others against the LDAP.
The users whose password will be validated against the database will have an specific attribute that will tell me that that password will be validated in my database.
How can I manage that? Is it possible that the validate_password_field receives a "variable"? That way I could create some method that will return true/false depending on where the password validation will be done?
Thanks!
Nicolás Hock Isaza
© Stack Overflow or respective owner