Defect #2040
closedfirst ldap auth mode does not works but the second does
0%
Description
Ok I set up two instances to test this.
Where I work the LDAP tree (AD) has a section for "faculty and staff" and other for "students" . Due to wanting students to be able to self reg I set up two auth methods, one for students (id => 1) and another for "faculty and staff" (id => 2). I never really tested the student one as it has not been used yet.
Then I needed to set up another instance that only "faculty and staff" have access to so I only set up one authentication method. It would not work. The test button was happy but now one could auth. I took the working site config and line by line copied the config and used the same user to connect to the ldap tree and to try and log in with. The only difference was that the first site had 2 auth methods with the working one being second and the second site had only one.
So I copied the first auth method on the second site to a second auth method and low and behold it worked and people could log in when the new auth menthod was set for them. Then I when back and tested the first auth method on the first site and it would not work also.
What seems happening is that this code
dn = String.new
ldap_con.search( :base => self.base_dn,
:filter => object_filter & login_filter,
# only ask for the DN if on-the-fly registration is disabled
:attributes=> (onthefly_register? ? ['dn', self.attr_firstname, self.attr_lastname, self.attr_mail] : ['dn'])) do |entry|
dn = entry.dn
is not running for the first auth method and the dn is empty so that when you get to
return nil if dn.empty?
the method returns.
I can not explain why this happens.