Giter Site home page Giter Site logo

Comments (2)

dirmgr avatar dirmgr commented on September 13, 2024

It sounds like the problem is with Active Directory and not with the LDAP SDK.

RFC 4518 states that for equality matching for matching rules that use insignificant space handling (which includes the cn attribute), sequences of multiple spaces are considered logically equivalent to a single space. Insignificant space handling is addressed in section 2.6.1, but a simpler explanation that applies for non-substring matching can be found in Appendix B, which states "all sequences of one or more spaces be replaced with one space and, if the string contains non-space characters, removal of all leading spaces and trailing spaces."

So in your example, the following would all be considered equivalent:

CN=F      O  O, CN=Bar
CN=F    O          O, CN=Bar
CN=F O O, CN=Bar

And to address your other point about capitalization, the cn attribute uses caseIgnore matching, so differences in capitalization are also considered insignificant. Attribute names are also always case insensitive, regardless of the syntax associated with that attribute. So in each of the cases listed above, the LDAP SDK should generate the following normalized representation:

cn=f o o,cn=bar

If it were to explicitly follow RFC 4518 section 2.6.1, it would yield:

cn=f  o  o,cn=bar

But that seems less natural (because it would convert every occurrence of a single space into two spaces), and because this particular normalized representation isn't intended for substring matching, it uses the simplified rules described in Appendix B.

from ldapsdk.

asaf-romano avatar asaf-romano commented on September 13, 2024

Thanks for the prompt reply!

I've never read the RFC, so I cannot reply on that. FWIW, LdapName (from javax) does not seem to consider the two equal.

from ldapsdk.

Related Issues (20)

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.