cancel
Showing results for 
Search instead for 
Did you mean: 

LDAP IMPORT PROBLEM

exa
Champ in-the-making
Champ in-the-making
Hi,

I'm using alfresco 1.3 on Debian. I'm trying to authenticate the users via an OPenLDAP database.

Although it adds the users, Alfresco doesn't allow me to authenticate via LDAP.

Here is a line in the alfresco.log file :

DEBUG [org.alfresco.repo.security.authentication.ldap.LDAPPersonExportSource] Adding user for alf
[org.alfresco.repo.security.authentication.ldap.LDAPPersonExportSource] Adding user for teddy
[org.alfresco.repo.security.authentication.ldap.LDAPPersonExportSource] Adding user for romeo
ERROR [org.quartz.core.JobRunShell] Job DEFAULT.ldapPeopleJobDetail threw an unhandled Exception:
org.alfresco.repo.importer.ExportSourceImporterException: Failed to import

How come the import fails ?.

Do I really have to enter the "job detail" info for all the users ?. 
:shock:


And I have another question : Is it possible to tell alfresco to authenticate users via LDAP on the first hand and then authenticate them via a local file on the second hand if the authentication via LDAP didn't succeed ?.

Thanks for the answers,
Regards,
/Exa
2 REPLIES 2

andy
Champ on-the-rise
Champ on-the-rise
Hi

Check your users have a uid (or that your LDAP query only selects such users), or move to the 1.4 code.
Can you post the full exception?

You can use chaining authentication to use the in built Alfresco auth if LDAP fails. See the security and athentication docs on the Wiki.

Regards

Andy

xietengfei
Champ in-the-making
Champ in-the-making
I  have the same problem 
and this is my ldap xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
   
 
   
    <bean name="authenticationDao" class="org.alfresco.repo.security.authentication.DefaultMutableAuthenticationDao" >
        <property name="allowDeleteUser">
            <value>true</value>
        </property>
    </bean>   
  

  
   
    <bean id="authenticationComponent" class="org.alfresco.repo.security.authentication.ldap.LDAPAuthenticationComponentImpl">
        <property name="LDAPInitialDirContextFactory">
            <ref bean="ldapInitialDirContextFactory"/>
        </property>
        <property name="userNameFormat">
          
            <value>%s</value>
        </property>
    </bean>
   
   
    <bean id="ldapInitialDirContextFactory" class="org.alfresco.repo.security.authentication.ldap.LDAPInitialDirContextFactoryImpl">
        <property name="initialDirContextEnvironment">
            <map>
                <!– The LDAP provider –>
                <entry key="java.naming.factory.initial">
                    <value>com.sun.jndi.ldap.LdapCtxFactory</value>
                </entry>
               
               
                <entry key="java.naming.provider.url">
                    <value>ldap://192.168.0.200:389</value>
                </entry>
               
              
                <entry key="java.naming.security.authentication">
                    <value>simple</value>
                </entry>
               
              
                <entry key="java.naming.security.principal">
                    <value>reader</value>
                </entry>
               
                <!– The password for the user defined above –>
                <entry key="java.naming.security.credentials">
                    <value>secret</value>
                </entry>
            </map>
        </property>
    </bean>
   
    
    <bean id="ldapPeopleExportSource" class="org.alfresco.repo.security.authentication.ldap.LDAPPersonExportSource">
       
        <property name="personQuery">
            <value>(objectclass=inetOrgPerson)</value>
        </property>
       
        <!–
        The seach base restricts the LDAP query to a sub section of tree on the LDAP server.
        –>
        <property name="searchBase">
            <value>dc=com</value>
        </property>
       
      
        <property name="userIdAttributeName">
            <value>uid</value>
        </property>
       
        <!– Services –>
        <property name="LDAPInitialDirContextFactory">
            <ref bean="ldapInitialDirContextFactory"/>
        </property>
        <property name="personService">
            <ref bean="personService"></ref>
        </property>
        <property name="namespaceService">
            <ref bean="namespaceService"/>
        </property>
       
       
        <property name="attributeMapping">
            <map>
                <entry key="cm:userName">
                   
                    <value>uid</value>
                </entry>
                <entry key="cm:firstName">
                   
                    <value>givenName</value>
                </entry>
                <entry key="cm:lastName">
                  
                    <value>sn</value>
                </entry>
                <entry key="cm:email">
                   
                    <value>mail</value>
                </entry>
                <entry key="cm:organizationId">
                   
                    <value>o</value>
                </entry>
                <!– Always use the default –>
                <entry key="cm:homeFolderProvider">
                    <null/>
                </entry>
            </map>
        </property>
       
        <property name="attributeDefaults">
            <map>
                <entry key="cm:homeFolderProvider">
                    <value>personalHomeFolderProvider</value>
                </entry>
            </map>
        </property>
    </bean>
   
    <!– Extract group information from LDAP and transform this to XML –>
   
    <bean id="ldapGroupExportSource" class="org.alfresco.repo.security.authentication.ldap.LDAPGroupExportSource">
       
        <property name="groupQuery">
            <value>(objectclass=groupOfNames)</value>
        </property>
       
        <!–
        The seach base restricts the LDAP query to a sub section of tree on the LDAP server.
        –>
        <property name="searchBase">
            <value>dc=alfresco,dc=org,dc=com</value>
        </property>
       
       
        <property name="userIdAttributeName">
            <value>uid</value>
        </property>
       
       
        <property name="groupIdAttributeName">
            <value>cn</value>
        </property>
       
     
        <property name="groupType">
            <value>groupOfNames</value>
        </property>
       
       
        <property name="personType">
            <value>inetOrgPerson</value>
        </property>
        <property name="LDAPInitialDirContextFactory">
            <ref bean="ldapInitialDirContextFactory"/>
        </property>
        <property name="namespaceService">
            <ref bean="namespaceService"/>
        </property>
       
      
        <property name="memberAttribute">
            <value>member</value>
        </property>
       
        <property name="authorityDAO">
            <ref bean="authorityDAO"/>
        </property>
    </bean>
   
  
   
   
    <bean id="ldapPeopleTrigger" class="org.alfresco.util.TriggerBean">
        <property name="jobDetail">
            <bean id="ldapPeopleJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
                <property name="jobClass">
                    <value>org.alfresco.repo.importer.ImporterJob</value>
                </property>
                <property name="jobDataAsMap">
                    <map>
                        <entry key="bean">
                            <ref bean="ldapPeopleImport"/>
                        </entry>
                    </map>
                </property>
            </bean>
        </property>
        <!– Start after 5 minutes of starting the repository –>
        <property name="startDelay">
            <value>30000</value>
        </property>
        <!– Repeat every hour –>
        <property name="repeatInterval">
            <value>3600000</value>
        </property>
       
        <property name="scheduler">
            <ref bean="schedulerFactory" />
        </property>
      
     
    </bean>
  
    <bean id="ldapGroupTrigger" class="org.alfresco.util.TriggerBean">
        <property name="jobDetail">
            <bean id="ldapGroupJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
                <property name="jobClass">
                    <value>org.alfresco.repo.importer.ImporterJob</value>
                </property>
                <property name="jobDataAsMap">
                    <map>
                        <entry key="bean">
                            <ref bean="ldapGroupImport"/>
                        </entry>
                    </map>
                </property>
            </bean>
        </property>
      
        <property name="startDelay">
            <value>30000</value>
        </property>
       
        <property name="repeatInterval">
            <value>3600000</value>
        </property>
       
        <property name="scheduler">
            <ref bean="schedulerFactory" />
        </property>
      
      
       
    </bean>


   
    <!– The bean that imports xml describing people –>
  
    <bean id="ldapPeopleImport" class="org.alfresco.repo.importer.ExportSourceImporter">
        <property name="importerService">
            <ref bean="importerComponentWithBehaviour"/>
        </property>
        <property name="transactionService">
            <ref bean="transactionComponent"/>
        </property>
        <property name="authenticationComponent">
            <ref bean="authenticationComponent"/>
        </property>
        <property name="exportSource">
            <ref bean="ldapPeopleExportSource"/>
        </property>

     
        <property name="storeRef">
            <value>${spaces.store}</value>
        </property>
       
       
        <property name="path">
            <value>/${system.system_container.childname}/${system.people_container.childname}</value>
        </property>
       
      
        <property name="clearAllChildren">
            <value>false</value>
        </property>
        <property name="nodeService">
            <ref bean="nodeService"/>
        </property>
        <property name="searchService">
            <ref bean="searchService"/>
        </property>
        <property name="namespacePrefixResolver">
            <ref bean="namespaceService"/>
        </property>
       
       
        <property name="caches">
            <set>
                <ref bean="permissionsAccessCache"/>
            </set>
        </property>
    </bean>
 
    <!– The bean that imports xml descibing groups –>
   
    <bean id="ldapGroupImport" class="org.alfresco.repo.importer.ExportSourceImporter">
        <property name="importerService">
            <ref bean="importerComponentWithBehaviour"/>
        </property>
        <property name="transactionService">
            <ref bean="transactionComponent"/>
        </property>
        <property name="authenticationComponent">
            <ref bean="authenticationComponent"/>
        </property>
        <property name="exportSource">
            <ref bean="ldapGroupExportSource"/>
        </property>
      
        <property name="storeRef">
            <value>${alfresco_user_store.store}</value>
        </property>
       
      
        <property name="path">
            <value>/${alfresco_user_store.system_container.childname}/${alfresco_user_store.authorities_container.childname}</value>
        </property>
       
      
        <property name="clearAllChildren">
            <value>true</value>
        </property>
        <property name="nodeService">
            <ref bean="nodeService"/>
        </property>
        <property name="searchService">
            <ref bean="searchService"/>
        </property>
        <property name="namespacePrefixResolver">
            <ref bean="namespaceService"/>
        </property>
       
       
        <property name="caches">
            <set>
                <ref bean="userToAuthorityCache"/>
                <ref bean="permissionsAccessCache"/>
            </set>
        </property>
       
       
    </bean>
   
   
</beans>


what is wrong  ?and my aflresco is 2.1.0  .