1.5.2 ApacheDS() loadLdifs Problem
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Directory Project > 1.5.2 ApacheDS() loadLdifs Problem




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    1.5.2 ApacheDS() loadLdifs Problem  
Simon.Temple-bNHniqfy2KDk7dXyY5I9mNBPR1lH4CV8@


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-21-07 12:11 PM

Hi

I can't start a 1.5.2 server via the ApacheDS class:

LdapPrincipal admin = new LdapPrincipal( new LdapDN( ServerDNConstants.ADMIN
_SYSTEM_DN ), AuthenticationLevel.STRONG );

java.lang.IllegalStateException: Names used for principals must be normalize
d!
at org.apache.directory.server.core.authn.LdapPrincipal.<init>(LdapPrincipal
.java:72)
at org.apache.directory.server.configuration.ApacheDS.loadLdifs(ApacheDS.jav
a:321)
at org.apache.directory.server.configuration.ApacheDS.startup(ApacheDS.java:
95)

Will it work if the code is changed to use ServerDNConstants.ADMIN_SYSTEM_DN
_NORMALIZED?


- SimonT





[ Post a follow-up to this message ]



    Re: 1.5.2 ApacheDS() loadLdifs Problem  
Simon.Temple-bNHniqfy2KDk7dXyY5I9mNBPR1lH4CV8@


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-21-07 12:11 PM

Update:

Changing the code to this seems to work:

LdapDN dn = new LdapDN();
dn.add( ServerDNConstants.ADMIN_SYSTEM_DN );
LdapPrincipal admin = new LdapPrincipal( dn, AuthenticationLevel.STRONG );

this is because the empty constructor sets isNormailized to true!

This smells like a work-around not a fix... anyone care to comment?

Thanks

- SimonT

21 December 2007 10:52
To: dev-aYN4UCa7k1r1N9kud6OZbmD2FQJk+8+b@public.gmane.org
cc: 
From: Simon.Temple-bNHniqfy2KDk7dXyY5I9mNBPR1lH4CV8@public.gmane.org
Subject: 1.5.2 ApacheDS() loadLdifs Problem


Hi

I can't start a 1.5.2 server via the ApacheDS class:

LdapPrincipal admin = new LdapPrincipal( new LdapDN( ServerDNConstants.ADMIN
_SYSTEM_DN ), AuthenticationLevel.STRONG );

java.lang.IllegalStateException: Names used for principals must be normalize
d!
at org.apache.directory.server.core.authn.LdapPrincipal.<init>(LdapPrincipal
.java:72)
at org.apache.directory.server.configuration.ApacheDS.loadLdifs(ApacheDS.jav
a:321)
at org.apache.directory.server.configuration.ApacheDS.startup(ApacheDS.java:
95)

Will it work if the code is changed to use ServerDNConstants.ADMIN_SYSTEM_DN
_NORMALIZED?


- SimonT





[ Post a follow-up to this message ]



    Re: 1.5.2 ApacheDS() loadLdifs Problem  
Alex Karasulu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-21-07 06:11 PM

There was another thread on exactly this problem.  I recommend you proceed
like so for now:

(1) get a handle on the DirectoryService
(2) access the attributeType registry via directoryService.getRegistries
().getAttributeTypeRegistry()
(3) from the attribute type registry access the normalizer map
getNormalizerMap() or something like that
(4) feed this into the dn.normalize() method of the dn you feed into
LdapPrincipal

The reason for all this is that a normalized DN is required in the
LdapPrincipal so the server can properly check and compare DNs for various
housekeeping operations and things like authorization and authentication.
If the DN is not normalized then these operations will not correctly
evaluate.  This is why an exception is thrown to stop unsuspecting users.

We do need to figure out a better way to handle this but until then this
sequence above should work.

Alex

On Dec 21, 2007 6:26 AM, <Simon.Temple-bNHniqfy2KDk7dXyY5I9mNBPR1lH4CV8@publ
ic.gmane.org> wrote:

>  Update:
>
> Changing the code to this seems to work:
>
>  LdapDN dn = new LdapDN();
>  dn.add( ServerDNConstants.ADMIN_SYSTEM_DN );
>  LdapPrincipal admin = new LdapPrincipal( dn, AuthenticationLevel.STRONG);
> this is because the empty constructor sets isNormailized to true!
>
> This smells like a work-around not a fix... anyone care to comment?
>
> Thanks
>
> - SimonT
>
> *21 December 2007 10:52
> To: dev-aYN4UCa7k1r1N9kud6OZbmD2FQJk+8+b@public.gmane.org
> cc:
> From: Simon.Temple-bNHniqfy2KDk7dXyY5I9mNBPR1lH4CV8@public.gmane.org
> Subject: 1.5.2 ApacheDS() loadLdifs Problem*
>
> Hi
>
> I can't start a 1.5.2 server via the ApacheDS class:
>
> LdapPrincipal admin = new LdapPrincipal( new LdapDN(
> ServerDNConstants.ADMIN_SYSTEM_DN ), AuthenticationLevel.STRONG );
>
> java.lang.IllegalStateException: Names used for principals must be
> normalized!
>  at org.apache.directory.server.core.authn.LdapPrincipal.<init>(
> LdapPrincipal.java:72)
>  at org.apache.directory.server.configuration.ApacheDS.loadLdifs(
> ApacheDS.java:321)
>  at org.apache.directory.server.configuration.ApacheDS.startup(
> ApacheDS.java:95)
>
> Will it work if the code is changed to use
> ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED?
>
>
> - SimonT
>






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:10 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register