Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-949

Add support for LDAP URLs in context searches

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.5.0
    • 2.1.0
    • core
    • None

    Description

      LDAP URLs (RFC 2255) are not supported in context searches when using CoreContextFactory. Searching with LDAP URLs is described in the Sun JNDI tutorial:

      http://java.sun.com/products/jndi/tutorial/ldap/misc/url.html

      We have full support of RFC 2255 in shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURL class. However, with CCF, as in the following code ...

      CoreContextFactory ccf = new CoreContextFactory();
      DirContext ctx = ( DirContext ) ccf.getInitialContext( env );
      
      String url = "ldap://localhost:" + port +
      "/ou=users,dc=example,dc=com?krb5PrincipalName?sub?(krb5PrincipalName=hnelson@EXAMPLE.COM)";
      
      NamingEnumeration answer = ctx.search( url, "", null );
      

      ... the LDAP URL format for the name is not supported and the following exception is thrown:

      javax.naming.InvalidNameException: Bad DN :
      ldap://localhost:1024/ou=users,dc=example,dc=com?krb5PrincipalName?sub?(krb5PrincipalName=hnelson@EXAMPLE.COM)
      at org.apache.directory.shared.ldap.name.LdapDnParser.parseInternal(LdapDnParser.java:151)
      at org.apache.directory.shared.ldap.name.LdapDN.<init>(LdapDN.java:197)

      Attachments

        Activity

          People

            Unassigned Unassigned
            enriquer9 Enrique Rodriguez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: