<?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 Re: Programmatically LDAP configuration in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/programmatically-ldap-configuration/m-p/191335#M144465</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Joram,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IMHO, I think there should be two possible ways of configuring the LDAP server:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Scheme, server and port as three separate properties&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;properties.put(Context.PROVIDER_URL, ldapConfigurator.getScheme() + "://" + ldapConfigurator.getServer() + ":" + ldapConfigurator.getPort());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. A complete URL including scheme, server and port, and possibly some other connection options (sometimes, LDAP server specific ones)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;properties.put(Context.PROVIDER_URL, ldapConfigurator.getConnectionURL());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Without the addition of other parameters, the first options will not have the possibility of specifying other options, like root o partition in URLs like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ldap://localhost:389/ou=employees,dc=company,dc=org&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That kind of connection options are not currently supported with the LDAPConfigurator, are they?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm really not an expert with LDAP, but an experienced user. May be the best answers could be found at the source: &lt;/SPAN&gt;&lt;A href="http://www.ietf.org/rfc/rfc2255.txt" rel="nofollow noopener noreferrer"&gt;http://www.ietf.org/rfc/rfc2255.txt&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for considering my suggestions!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;M.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Jun 2015 19:30:54 GMT</pubDate>
    <dc:creator>matutano6</dc:creator>
    <dc:date>2015-06-02T19:30:54Z</dc:date>
    <item>
      <title>Programmatically LDAP configuration</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/programmatically-ldap-configuration/m-p/191332#M144462</link>
      <description>Hi,I'm trying to configure LDAP on a ProcessEngine by doing it programmatically on Activiti 5.14. First, I want to use the default configuration resource (i.e. activiti.cf.xml) and then configure the LDAP properties. Everythings seems to work until the engine tries to do queries to the LDAP server;</description>
      <pubDate>Fri, 22 May 2015 15:43:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/programmatically-ldap-configuration/m-p/191332#M144462</guid>
      <dc:creator>matutano6</dc:creator>
      <dc:date>2015-05-22T15:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically LDAP configuration</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/programmatically-ldap-configuration/m-p/191333#M144463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I found the problem and I want to share the experience.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Effectively, the problem was that the InitialDirContext could not be created, but the exception was not logged due to the configuration of the logger. The exception thrown was:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Caused by: javax.naming.NamingException: Cannot parse url: 1xx.2xx.3xx.4xx:10389 [Root exception is java.net.MalformedURLException: Not an LDAP URL: 1xx.2xx.3xx.4xx:10389]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sun.jndi.ldap.LdapURL.&amp;lt;init&amp;gt;(LdapURL.java:95)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:164)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at javax.naming.InitialContext.init(InitialContext.java:240)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at javax.naming.InitialContext.&amp;lt;init&amp;gt;(InitialContext.java:214)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at javax.naming.directory.InitialDirContext.&amp;lt;init&amp;gt;(InitialDirContext.java:99)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.ldap.LDAPConnectionUtil.createDirectoryContext(LDAPConnectionUtil.java:54)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; … 204 more&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Caused by: java.net.MalformedURLException: Not an LDAP URL: 1xx.2xx.3xx.4xx:10389&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sun.jndi.ldap.LdapURL.&amp;lt;init&amp;gt;(LdapURL.java:89)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; … 214 more&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After looking at the code, the LDAPConnectionUtil does the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;properties.put(Context.PROVIDER_URL, ldapConfigurator.getServer() + ":" + ldapConfigurator.getPort());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It means that the resulting string after the concatenation of &amp;lt;em&amp;gt;ldapConfigurator.getServer() + ":" + ldapConfigurator.getPort()&amp;lt;/em&amp;gt; should contain the URL's scheme (i.e. ldap:// or ldaps://). Immediatelly, a looked into the activiti.cfg.cml and remember that the scheme must be part of the server element:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;property name="server" value="ldap://1xx.2xx.3xx.4xx" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, the short story: remember to add the scheme!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And finally, I would like to suggest a tweak here. The LDAP could be cofigured using an URL instead of an IP (with scheme) and a TCP port. If I'm not wrong, software that use LDAP are tending to configure the connection through an URL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;M.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 13:51:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/programmatically-ldap-configuration/m-p/191333#M144463</guid>
      <dc:creator>matutano6</dc:creator>
      <dc:date>2015-05-27T13:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically LDAP configuration</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/programmatically-ldap-configuration/m-p/191334#M144464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for sharing the solution to your problem!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'ù not following the remark about the URL. Do you mean that we should not use 'ldapConfigurator.getServer() + ":" + ldapConfigurator.getPort()', but pass a URl directly?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2015 19:07:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/programmatically-ldap-configuration/m-p/191334#M144464</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2015-06-02T19:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically LDAP configuration</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/programmatically-ldap-configuration/m-p/191335#M144465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Joram,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IMHO, I think there should be two possible ways of configuring the LDAP server:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Scheme, server and port as three separate properties&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;properties.put(Context.PROVIDER_URL, ldapConfigurator.getScheme() + "://" + ldapConfigurator.getServer() + ":" + ldapConfigurator.getPort());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. A complete URL including scheme, server and port, and possibly some other connection options (sometimes, LDAP server specific ones)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;properties.put(Context.PROVIDER_URL, ldapConfigurator.getConnectionURL());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Without the addition of other parameters, the first options will not have the possibility of specifying other options, like root o partition in URLs like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ldap://localhost:389/ou=employees,dc=company,dc=org&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That kind of connection options are not currently supported with the LDAPConfigurator, are they?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm really not an expert with LDAP, but an experienced user. May be the best answers could be found at the source: &lt;/SPAN&gt;&lt;A href="http://www.ietf.org/rfc/rfc2255.txt" rel="nofollow noopener noreferrer"&gt;http://www.ietf.org/rfc/rfc2255.txt&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for considering my suggestions!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;M.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2015 19:30:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/programmatically-ldap-configuration/m-p/191335#M144465</guid>
      <dc:creator>matutano6</dc:creator>
      <dc:date>2015-06-02T19:30:54Z</dc:date>
    </item>
  </channel>
</rss>

