LDAP extra_attributes (memberof not returning fix)
aurelienduarte opened this issue · 0 comments
aurelienduarte commented
Due to the fact that memberof is not an actual attribute, it has to be explicitly requested as an attribute in the searchRequest to be returned, this can be addressed by explicitly defining that the extra_attributes are returned on the search request as follows:
def find_user
results= if @options[:extra_attributes]
@ldap.search(:base => options[:ldap][:base], :filter => user_filter,
:attributes => @options[:extra_attributes].gsub(/ */, '').split(','))
else
@ldap.search(:base => options[:ldap][:base], :filter => user_filter)
end
return results.first
end
A side effect of this change is an optimised/lighter search.