Giter VIP home page Giter VIP logo

casino-ldap_authenticator's People

Contributors

dayer4b avatar pencil avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

casino-ldap_authenticator's Issues

Extra attributes with multiple values are lost in transit

When a user authenticates and user data, along with extra attributes, are loaded (especially with the Net::LDAP#search fix - see pull request #4 ), the user data that is returned may be missing some values.

I have seen this with the data from the OpenLDAP memberof overlay, which creates multiple entries named 'memberof' for each group to which the user belongs.

I recommend the following change:

  def extra_attributes
    if @options[:extra_attributes]
      result = {}
      @options[:extra_attributes].each do |index_result, index_ldap|
        value = @user_plain[index_ldap]
        if value
          result[index_result] = "#{value.join(', ')}"
        end
      end
      result
    else
      nil
    end
  end

This will keep the attribute values in string form and also permit multiple values.

I'll submit a Pull Request with this soon.

Net::LDAP#bind_as should not be used to pull user data

Net::LDAP#bind_as should not be used to pull data, instead the #search method should be used.

Although the Net::LDAP documentation indicates that #bind_as is a combination of search and LDAP binding, it's not as effective as #search in practice because it does not pull a variable list of attributes.

This problem is significant because the usage of the extra_attributes setting in the cas.yml file is somewhat restricted by this usage of #bind_as.

I'd recommend using the Net::LDAP#search method. I've tested this, and can pull extra data like group membership (using the 'memberof' overlay in OpenLDAP, for example).

I'll make a pull request shortly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.