Re: lookupUserFromDN to Active Directory fails after 405 upgrade

Thomas Draier <[email protected]>
Newsgroups gmane.comp.cms.jahia.devel
Message-ID <[email protected]>
hi pascal,
i've made the change on the JAHIA-4-0-BRANCH and created a patch for 
this version, but you can also apply it on the JAHIA_4_0_5. strangely 
the patch is already applied on JahiaGroupManagerLDAPProvider - you 
only need to change JahiaUserManagerLDAPProvider. then try to set the 
parameter users.ldap.refferal to "follow" instead of the default 
"ignore" in your property file.
thomas





Le 24 janv. 05, à 18:43, Pascal a écrit :

> I'll try that, but could you point me to the correct version of the  
> sourcefiles I should start with when applying the suggested fix?
>
> I'm guessing these are the right versions, but I'm not sure
> http://cvspub.jahia.org/cgi-bin/cvsweb.cgi/jahia/src/java/org/jahia/ 
> services/usermanager/Attic/JahiaGroupManagerLDAPProvider.java? 
> only_with_tag=JAHIA_4_0_5
> http://cvspub.jahia.org/cgi-bin/cvsweb.cgi/jahia/src/java/org/jahia/ 
> services/usermanager/Attic/JahiaUserManagerLDAPProvider.java? 
> only_with_tag=JAHIA_4_0_5
>
> tia
> pascal
>
> ----- Original Message ----- From: "Thomas Draier"  
> <[email protected]>
> To: <[email protected]>
> Sent: Monday, January 24, 2005 3:29 PM
> Subject: Re: lookupUserFromDN to Active Directory fails after 405  
> upgrade
>
>
> hi,
> this may be related to a referral server problem, as described in
> http://www.mail-archive.com/[email protected]/msg00235.html . a patch
> was provided at that time, but it think it's not in 4.0.5, only in the
> cvs head - you can try to add the parameter described by anton in the
> connectToPublicDir method . but the complete stack trace would be
> useful for a better understanding of the problem.
> thomas
>
> Le 24 janv. 05, à 14:40, Pascal a écrit :
>
>> Both in the administration and in the user rights panels for   
>> containers, looking up users in Active Directory yields the following  
>>  errors.
>>
>> Lookup of Active Directory groups works and login to the site with an  
>> Active Directory user is no problem. The new settings in  
>> group-router-config.xml and router-config.xml appear to be configured  
>> correctly, including the  
>> <factory>com.sun.jndi.ldap.LdapCtxFactory</factory> setting to which   
>> the problem seems related.
>>
>> usermanager.JahiaUserManagerLDAPProvider lookupUserFromDN - JNDI   
>> warning
>> javax.naming.PartialResultException. Root exception is
>> javax.naming.AuthenticationException: [LDAP: error code 49 -  
>> 80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext  
>> error, data  52e, v893
>> <snip>
>> WARN usermanager.JahiaUserManagerLDAPProvider lookupUserFromDN - JNDI  
>> warning
>> javax.naming.NoInitialContextException: Need to specify class name in  
>> environment or system property, or as an applet parameter, or in an  
>> application resource file: java.naming.factory.initial
>> at   
>> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:  
>> 652)
>>
>> Any help is appreciated
>> pascal
JahiaUserManagerLDAPProvider.patch (application/octet-stream, 1.4 KB)
Index: JahiaUserManagerLDAPProvider.java
===================================================================
RCS file: /home/cvs/repository/jahia/src/java/org/jahia/services/usermanager/Attic/JahiaUserManagerLDAPProvider.java,v
retrieving revision 1.32.4.10
diff -u -r1.32.4.10 JahiaUserManagerLDAPProvider.java
--- JahiaUserManagerLDAPProvider.java	14 Jan 2005 14:53:49 -0000	1.32.4.10
+++ JahiaUserManagerLDAPProvider.java	24 Jan 2005 17:54:53 -0000
@@ -106,7 +106,7 @@
     private static String USERS_OBJECTCLASS_ATTRIBUTE =
         "users.ldap.search.objectclass";
 
-    private static String LDAP_REFFERAL_PROP = "groups.ldap.refferal";
+    private static String LDAP_REFFERAL_PROP = "users.ldap.refferal";
     private static String SEARCH_COUNT_LIMIT_PROP =
         "users.ldap.search.countlimit";
     private static String SEARCH_WILDCARD_ATTRIBUTE_LIST =
@@ -1254,6 +1254,8 @@
                 ldapProperties.getProperty (AUTHENTIFICATION_MODE_PROP));
         publicEnv.put (Context.SECURITY_PRINCIPAL,
                 ldapProperties.getProperty (PUBLIC_BIND_DN_PROP));
+        publicEnv.put (Context.REFERRAL,
+                       ldapProperties.getProperty (LDAP_REFFERAL_PROP, "ignore"));
         if (ldapProperties.getProperty (PUBLIC_BIND_PASSWORD_PROP) != null) {
             logger.debug ("Using authentification mode to connect to public dir...");
             publicEnv.put (Context.SECURITY_CREDENTIALS,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.