Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP extra_attributes (memberof not returning fix) #173

Open
aurelienduarte opened this issue Jun 7, 2013 · 0 comments
Open

LDAP extra_attributes (memberof not returning fix) #173

aurelienduarte opened this issue Jun 7, 2013 · 0 comments

Comments

@aurelienduarte
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant