directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@apache.org>
Subject Re: [LDAP] Parsing LDAP URLs
Date Wed, 30 May 2007 23:55:18 GMT
Enrique Rodriguez a écrit :

> 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.

Yes, I think we don't support LdapURL in CCF.

>
> 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?

You can fill a JIRA asking for CCF to support LdapURL, sure.

Emmanuel


Mime
View raw message