<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic use an LDAP attribute for authentification instead of the dn in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/use-an-ldap-attribute-for-authentification-instead-of-the-dn/m-p/50351#M29203</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;we needed to authenticate against our LDAP directory where the user login has been saved as a unique attribute. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So our problem was Alfresco only permits to authenticate using the full user dn.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've written this little code to resolve this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. first you have to set up the file "ldap-authentication-context.xml" like this, with your own values for seachBase and unique_LDAPattribute_name:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt; &lt;BR /&gt;&amp;lt;!– LDAP authentication configuration –&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean id="authenticationComponentImpl" class="org.alfresco.repo.security.authentication.ldap.LDAPAuthenticationComponentImpl_ucl"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="LDAPInitialDirContextFactory"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="ldapInitialDirContextFactory"/&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="searchBase"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;ou=London,dc=company,dc=com&amp;lt;/value&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="unique_LDAPattribute_name"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;uid&amp;lt;/value&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Then you compile and install the following class:&lt;/SPAN&gt;&lt;A href="http://www.ipsp.ucl.ac.be/alfresco/LDAPAuthenticationComponentImpl_ucl.java" rel="nofollow noopener noreferrer"&gt;http://www.ipsp.ucl.ac.be/alfresco/LDAPAuthenticationComponentImpl_ucl.java&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Compiled code is available at: &lt;/SPAN&gt;&lt;A href="http://www.ipsp.ucl.ac.be/alfresco/LDAPAuthenticationComponentImpl_ucl.class" rel="nofollow noopener noreferrer"&gt;http://www.ipsp.ucl.ac.be/alfresco/LDAPAuthenticationComponentImpl_ucl.class&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;note: put the file in:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$TOMCAT/webapps/alfresco/WEB-INF/classes/org/alfresco/repo/security/authentication/ldap&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. restart tomcat&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4. set &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;log4j.logger.org.alfresco.repo.security.authentication.ldap=debug&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in log4J.properties will help you in case of problems&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this will help someones ….&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bernard.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Nov 2006 10:20:47 GMT</pubDate>
    <dc:creator>bparis</dc:creator>
    <dc:date>2006-11-27T10:20:47Z</dc:date>
    <item>
      <title>use an LDAP attribute for authentification instead of the dn</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/use-an-ldap-attribute-for-authentification-instead-of-the-dn/m-p/50351#M29203</link>
      <description>we needed to authenticate against our LDAP directory where the user login has been saved as a unique attribute. So our problem was Alfresco only permits to authenticate using the full user dn.I've written this little code to resolve this.1. first you have to set up the file "ldap-authentication-cont</description>
      <pubDate>Mon, 27 Nov 2006 10:20:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/use-an-ldap-attribute-for-authentification-instead-of-the-dn/m-p/50351#M29203</guid>
      <dc:creator>bparis</dc:creator>
      <dc:date>2006-11-27T10:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: use an LDAP attribute for authentification instead of the dn</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/use-an-ldap-attribute-for-authentification-instead-of-the-dn/m-p/50352#M29204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your post.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is true that simple authentication must use the DN and looking up a user by some other attribute is very useful. However, it assumes you can bind anonymously and have access to read the required attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Digest authentication can be used with the uid. For open ldap the query you have done is effectively done during the authentication process on the server, as opposed to before hand. I believe AD will accept the sAMAccountName but have not confirmed this on the many varients. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 14:33:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/use-an-ldap-attribute-for-authentification-instead-of-the-dn/m-p/50352#M29204</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2006-11-30T14:33:59Z</dc:date>
    </item>
  </channel>
</rss>

