Bonjour à tous,Je vous expose mon problème : j'utilise...

cancel
Showing results for 
Search instead for 
Did you mean: 
arno
Member II

Bonjour à tous,Je vous expose mon problème : j'utilise...

Bonjour à tous,

Je vous expose mon problème : j'utilise actuellement Alfresco v2.1.0 et pour les besoins d'un client j'ai à le configurer avec Active Directory.
Le but de cette configuration serait d'utiliser AD à la fois pour récupérer les utilisateurs et groupes mais aussi pour la connexion à Alfresco.
Or, je ne trouve aucune procédure pas à pas pour réaliser cette opération. J'ai eu beau regarder le wiki anglais d'Alfresco ainsi que les différents forums mais je ne trouve aucune aide précise pour un néophyte comme moi en matière d'AD.
Merci par avance pour l'aide que vous voudrez bien m'apporter.

Arnaud
16 Replies
lme
Partner

Re: Bonjour à tous,Je vous expose mon problème : j'utilise...

Bonjour arno,

Le mot clé à chercher dans le wiki alfresco est : ntlm. C'est la méthode d'authentification utilisée entre Alfresco et AD.
arno
Member II

Re: Bonjour à tous,Je vous expose mon problème : j'utilise...

Merci pour ta réponse je vais regarder tout cela.
arno
Member II

Re: Bonjour à tous,Je vous expose mon problème : j'utilise...

Bonjour,

Je me suis repenché sur la configuration Alfresco / Active Directory mais hélas tout ne marche pas comme prévu…….
J'ai configuré NTLM, j'arrive à me connecter à Alfresco via mon couple login/password stocké dans AD mais dès que je clique sur un lien j'obtiens l'exception suivante :

14:12:04,633 ERROR [[localhost].[/alfresco].[Faces Servlet]] "Servlet.service()" pour la servlet Faces Servlet a généré une exception
net.sf.acegisecurity.AuthenticationServiceException: Failed to open passthru auth session
        at org.alfresco.repo.security.authentication.ntlm.NTLMAuthenticationComponentImpl.authenticatePassthru(NTLMAuthenticationComponentImpl.java:793)
        at org.alfresco.repo.security.authentication.ntlm.NTLMAuthenticationComponentImpl.authenticate(NTLMAuthenticationComponentImpl.java:550)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
        at $Proxy18.authenticate(Unknown Source)
        at org.alfresco.web.app.servlet.NTLMAuthenticationFilter.processType1(NTLMAuthenticationFilter.java:523)
        at org.alfresco.web.app.servlet.NTLMAuthenticationFilter.doFilter(NTLMAuthenticationFilter.java:395)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:544)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
        at java.lang.Thread.run(Thread.java:619)
J'ai essayé sans succès plusieurs paramétrage et je suis cette fois définitivement perdu…
Quelqu'un aurait-il une idée sur ce problème?
Merci d'avance.

Arno
michaelh
Active Member

Re: Bonjour à tous,Je vous expose mon problème : j'utilise...

Il faudrait si possible nous montrer les fichiers de configuration pour qu'on puisse se faire une idée un peu plus précise.
(en oubliant pas de cacher les mots de passe et autres informations sensibles)
arno
Member II

Re: Bonjour à tous,Je vous expose mon problème : j'utilise...

file-servers-custom.xml

<alfresco-config area="file-servers">
  <config evaluator="string-compare" condition="CIFS Server">
    <serverEnable enabled="false" />
    <!– Insert here IP or hostname of this alfresco server, and the NT domain name in which you want to integrate–>
    <host name="NAME" domain="DOM.FR" />
    <comment>Alfresco CIFS Server</comment>
    <!– Set to the broadcast mask for the subnet –>
    <broadcast>255.255.255.255</broadcast>
    <sessionDebug flags="Negotiate,Socket" />
  </config>
  <config evaluator="string-compare" condition="Filesystems" replace="true">
    <filesystems>
      <filesystem name="Alfresco">
        <store>workspace://SpacesStore</store>
        <rootPath>/app:company_home</rootPath>
        <!– Add a URL file to each folder that links back to the web client –>
        <urlFile>
          <filename>__Alfresco.url</filename>
          <webpath>http://${localname}:8080/alfresco/</webpath>
        </urlFile>
        <!– Mark locked files as offline –>
        <offlineFiles />
        <!– Desktop actions –>
        <desktopActions>
          <global>
            <path>alfresco/desktop/Alfresco.exe</path>
            <webpath>http://${localname}:8080/alfresco/</webpath>
          </global>
          <action>
            <class>org.alfresco.filesys.smb.server.repo.desk.CheckInOutDesktopAction</class>
            <name>CheckInOut</name>
            <filename>__CheckInOut.exe</filename>
          </action>
          <action>
            <class>org.alfresco.filesys.smb.server.repo.desk.JavaScriptDesktopAction</class>
            <name>JavaScriptURL</name>
            <filename>__ShowDetails.exe</filename>
            <script>alfresco/desktop/showDetails.js</script>
            <attributes>anyFiles</attributes>
            <preprocess>copyToTarget</preprocess>
          </action>
        </desktopActions>
      </filesystem>
      <!– AVM virtualization view of all stores/versions for WCM –>
      <avmfilesystem name="AVM">
        <virtualView />
      </avmfilesystem>
    </filesystems>
  </config>
  <!– Authenticator should be of type alfresco –>
  <config evaluator="string-compare" condition="Filesystem Security" replace="true">
    <authenticator type="alfresco" />
  </config>
</alfresco-config>
ntlm-authentication-context.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 id="authenticationDao" class="org.alfresco.repo.security.authentication.ntlm.NullMutableAuthenticationDao" />
  <bean id="authenticationComponent" class="org.alfresco.repo.security.authentication.ntlm.NTLMAuthenticationComponentImpl">
    <property name="personService">
      <ref bean="personService" />
    </property>
    <property name="nodeService">
      <ref bean="nodeService" />
    </property>
    <property name="transactionService">
      <ref bean="transactionComponent" />
    </property>
    <property name="guestAccess">
      <value>false</value>
    </property>
    <!– Name of the windows domain  domain controller hostname or ip –>
    <property name="servers">
      <value>DOMAINEadresseAD</value>
    </property>
  </bean>
</beans>
custom-authority-services-context.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 id="authorityService" class="org.alfresco.repo.security.authority.AuthorityServiceImpl">
        <property name="authenticationComponent">
            <ref bean="authenticationComponent" />
        </property>
        <property name="personService">
            <ref bean="personService" />
        </property>
        <property name="nodeService">
            <ref bean="nodeService" />
        </property>
        <property name="authorityDAO">
            <ref bean="authorityDAO" />
        </property>
        <property name="permissionServiceSPI">
            <ref bean="permissionServiceImpl" />
        </property>
        <property name="adminUsers">
            <set>
             <value>USER</value> <!– add an NTLM user as an Administrator –>
             <value>admin</value>
             <value>administrator</value>
          </set>
        </property>
    </bean>
</beans>
ldap-authentication-context.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 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>
        <!– The url to the LDAP server –>
        <!– Note you can use space separated urls - they will be tried in turn until one works –>
        <!– This could be used to authenticate against one or more ldap servers (you will not know which one ….) –>
        <entry key="java.naming.provider.url">
          <value>ldap://adresseAD:389</value>
        </entry>
        <!– The authentication mechanism to use      –>
        <!– Some sasl authentication mechanisms may require a realm to be set –>
        <!–                java.naming.security.sasl.realm –>
        <!– The available options will depend on your LDAP provider –>
        <entry key="java.naming.security.authentication">
          <value>simple</value>
        </entry>
        <!– The id of a user who can read group and user information –>
        <entry key="java.naming.security.principal">
          <value>USER</value>
        </entry>
        <!– The password for the user defined above –>
        <entry key="java.naming.security.credentials">
          <value>PASSWD</value>
        </entry>
      </map>
    </property>
  </bean>
  <!– Ldap Syncronisation support –>

  <!–     There can be more than one stack of beans that import users or groups. For example, it may be easier to have a version of ldapPeopleExportSource, and associated beans, for each sub-tree of your ldap directory from which you want to        import users. You could then limit users to be imported from two or more sub tress and ignore users found else where. The same applies to the import of groups.        
  –>
  <!– Extract user information from LDAP and transform this to XML –>
  <bean id="ldapPeopleExportSource" class="org.alfresco.repo.security.authentication.ldap.LDAPPersonExportSource">
    <!–
      The query to select objects that represent the users to import. For Active Directory: (objectclass=user)
    –>
    <property name="personQuery">
      <value>(objectclass=user)</value>
    </property>
    <!–
      The search base restricts the LDAP query to a sub section of tree on the LDAP server.
      In this particular example we imported only the IT Department users.
    –>
    <property name="searchBase">
      <value>ou=ALL,dc=dom,dc=fr</value>
    </property>
    <!–
      The unique identifier for the user.THIS MUST MATCH WHAT THE USER TYPES IN AT THE LOGIN PROMPT  
      For simple LDAP authentication this is likely to be "cn" or, less friendly, "distinguishedName"
      In Active Directory this is most likely to be "sAMAccountName". This property is mandatory and must appear on all users found by the query defined above.
    –>
    <property name="userIdAttributeName">
      <value>sAMAccountName</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>
    <!–
      This property defines a mapping between attributes held on LDAP user objects and the properties of user objects held in the repository. The key is the QName of an attribute in the repository, the value is the attribute name from the user/       inetOrgPerson/.. object in the LDAP repository.    
    –>
    <property name="attributeMapping">
      <map>
        <entry key="cm:userName">
          <!– Must match the same attribute as userIdAttributeName –>
          <value>sAMAccountName</value>
        </entry>
        <entry key="cm:firstName">
          <!– Active Directory: "givenName" –>
          <value>givenName</value>
        </entry>
        <entry key="cm:lastName">
          <!– Active Directory: "sn" –>
          <value>sn</value>
        </entry>
        <entry key="cm:email">
          <!– Active Directory: "???" –>
          <value>mail</value>
        </entry>
        <entry key="cm:organizationId">
          <!– Active Directory: "???" –>
          <value>o</value>
        </entry>
        <!– Always use the default –>
        <entry key="cm:homeFolderProvider">
          <null />
        </entry>
      </map>
    </property>
    <!– Set a default home folder provider. We configured it to create user home folder under  "User Homes" space–>
    <property name="attributeDefaults">
      <map>
        <entry key="cm:homeFolderProvider">
          <value>userHomesHomeFolderProvider</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">
    <!–
      The query to select objects that represent the groups to import.
      For Active Directory: (objectclass=group)
    –>
    <property name="groupQuery">
      <value>(objectclass=group)</value>
    </property>
    <!– The seach base restricts the LDAP query to a sub section of tree on the LDAP server. We reduced it to IT departments internal groups  –>
    <property name="searchBase">
      <value>ou=IT Department,dc=mycompany,dc=org</value>
    </property>
    <!–        The unique identifier for the user. This must match the userIdAttributeName on the ldapPeopleExportSource bean above.        –>
    <property name="userIdAttributeName">
      <value>sAMAccountName</value>
    </property>
    <!–   An attribute that is a unique identifier for each group found. This is also the name of the group with the current group implementation.This is mandatory for any groups found.      
      Active Directory: "cn"  –>
    <property name="groupIdAttributeName">
      <value>cn</value>
    </property>
    <!–  The objectClass attribute for group members. For each member of a group, the distinguished name is given.The object is looked up by its DN. If the object is of this class it is treated as a group. –>
    <property name="groupType">
      <value>group</value>
    </property>
    <!– The objectClass attribute for person members.For each member of a group, the distinguished name is given.The object is looked up by its DN. If the object is of this class it is treated as a person –>
    <property name="personType">
      <value>user</value>
    </property>
    <property name="LDAPInitialDirContextFactory">
      <ref bean="ldapInitialDirContextFactory" />
    </property>
    <property name="namespaceService">
      <ref bean="namespaceService" />
    </property>
    <!–
      The repeating attribute on group objects (found by query or as sub groups) used to define membership of the group. This is assumed to hold distinguished names oF other groups or users/people; the above types are used to determine this.      
      Active Directory: "member"   –>
    <property name="memberAttribute">
      <value>member</value>
    </property>
    <property name="authorityDAO">
      <ref bean="authorityDAO" />
    </property>
  </bean>
  <!– Job definitions to import LDAP people and groups –>
  <!– The triggers register themselves with the scheduler –>
  <!– You may comment in the default scheduler to enable these triggers –>
  <!– If a cron base trigger is what you want seee scheduled-jobs-context.xml for examples. –>
  <!– Trigger to load poeple Note you can have more than one initial (context, trigger, import job and export source) seT. This would allow you to load people from more than one ldap store –>
  <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>180000</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>
    <!– Start after 5 minutes of starting the repository –>
    <property name="startDelay">
      <value>180000</value>
    </property>
    <!– Repeat every hour –>
    <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>

    <!– The store that contains people - this should not be changed –>
    <property name="storeRef">
      <value>${spaces.store}</value>
    </property>

    <!– The location of people nodes within the store defined above - this should not be changed –>
    <property name="path">
      <value>/${system.system_container.childname}/${system.people_container.childname}</value>
    </property>

    <!– If true, clear all existing people before import, if false update/add people from the xml –>
    <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>
    <!– The store that contains group information - this should not be changed –>
    <property name="storeRef">
      <value>${alfresco_user_store.store}</value>
    </property>

    <!– The location of group information in the store above - this should not be changed –>
    <property name="path">
      <value>/${alfresco_user_store.system_container.childname}/${alfresco_user_store.authorities_container.childname}</value>
    </property>

    <!– If true, clear all existing groups before import, if false update/add groups from the xml –>
    <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>

    <!– caches to clear on import of groups –>
    <property name="caches">
      <set>
        <ref bean="userToAuthorityCache" />
        <ref bean="permissionsAccessCache" />
      </set>
    </property>

    <!– userToAuthorityCache –>
  </bean>

</beans>
Voilà tout…

Arno
arno
Member II

Re: Bonjour à tous,Je vous expose mon problème : j'utilise...

Aucune suggestion?
huberd
Member II

Re: Bonjour à tous,Je vous expose mon problème : j'utilise...

Oui va voir ma réponse sur le post suivant : http://forum.alfresco-fr.org/viewtopic.php?id=1256

NTLM + AD + CIFS sur Linux RedHat avec Samba et FTP et CIFS sur serveur Windows 2003.
arno
Member II

Re: Bonjour à tous,Je vous expose mon problème : j'utilise...

Merci beaucoup Huberd pour tes informations cependant après avoir configuré Alfresco comme indiqué dans le post j'ai toujours le même problème que précédemment.

Arno
huberd
Member II

Re: Bonjour à tous,Je vous expose mon problème : j'utilise...

Merci beaucoup Huberd pour tes informations cependant après avoir configuré Alfresco comme indiqué dans le post j'ai toujours le même problème que précédemment.

Arno
Quelle version d'Alfresco utilises-tu ?