directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Enrique Rodriguez" <enriqu...@gmail.com>
Subject Re: [LDAP] Parsing LDAP URLs
Date Wed, 30 May 2007 23:43:31 GMT
On 5/30/07, Emmanuel Lecharny <elecharny@apache.org> wrote:
> ...
> is it asap enough for you ? :)

1)  LdapUrl works great.  However, it doesn't look like I can use it
directly in searches using CoreContextFactory.  LDAP URLs are
supported by Sun JNDI for remote searches, since LDAP URL's are parsed
client-side by a Sun provider.

However, with CCF, as in the following code:

{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 );
{code}

I get:

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)

Certainly I can work around this by using LdapUrl's getters as
parameters to my ctx.search#.  Should this be supported?  Want a JIRA?

Enrique

Mime
View raw message