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

Referral filter is not decoded. Space character (%20) breaks the following LDAP search (3.6.0) #240

Open
msstep opened this issue Dec 8, 2023 · 0 comments

Comments

@msstep
Copy link

msstep commented Dec 8, 2023

Hello,
I use ReferralFollowing settings for a cross domain LDAP search. If there is a space character in the filter, it does not work.

It looks like this:

Response with referral exception:

image

response content:

image

the following query returns "noSuchObject":

image

You may have forgotten to use the static "Decode" method

image

For example, here

image

Is there a workaround?

My code:

      var ldapConnection = new LdapConnection { SecureSocketLayer = false };
      
      // connect to domain A
      ldapConnection.Connect("domenA.rt.test", 389);

      // use referral settings
      Novell.Directory.Ldap.LdapSearchConstraints cons = ldapConnection.SearchConstraints;
      cons.ReferralFollowing = true;
      cons.setReferralHandler(new MyReferralHandler("user1-from-A", "123456"));
      ldapConnection.Constraints = cons;

      // bind to A
      ldapConnection.Bind(3, "user1-from-A", "123456");
      string[] attr = { "objectClass", "member", "distinguishedName", "userPrincipalName", "sAMAccountName", "mail", "objectGUID" };

      // use search filter with domain B ("users B" with space symbol between)

      var searchResults =
          ldapConnection.Search(
              "CN=user1-from-B,OU=users B,DC=domenB,DC=rt,DC=test",
              2,
              "(|(objectCategory=group)(objectClass=group)(&(objectCategory=person)(objectClass=user)))",
              attr,
              false,
              (LdapSearchConstraints)null
          );
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