Skip to content

Commit

Permalink
Protect against passwordless auth in ldap
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan OMara committed Oct 31, 2012
1 parent 1de1791 commit e4c90a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ldap_fluff/ldap_fluff.rb
Expand Up @@ -23,7 +23,12 @@ def initialize(config=nil)
# return true if the user password combination
# authenticates the user, otherwise false
def authenticate?(uid, password)
@ldap.bind? uid, password
if password.nil? || password.empty?
# protect against passwordless auth from ldap server
return false
else
@ldap.bind? uid, password
end
end

# return a list[] of groups for a given uid
Expand Down

0 comments on commit e4c90a5

Please sign in to comment.