<?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 Programmatically LDAP configuration in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/programmatically-ldap-configuration/m-p/191332#M144462</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;SPAN&gt;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; then I get the following exception:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;java.lang.NullPointerException&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.ldap.LDAPQueryBuilder$1.executeInContext(LDAPQueryBuilder.java:62)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.ldap.LDAPQueryBuilder$1.executeInContext(LDAPQueryBuilder.java:55)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.ldap.LDAPTemplate.execute(LDAPTemplate.java:44)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.ldap.LDAPQueryBuilder.buildQueryGroupsForUser(LDAPQueryBuilder.java:55)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.ldap.LDAPGroupManager$1.executeInContext(LDAPGroupManager.java:115)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.ldap.LDAPGroupManager$1.executeInContext(LDAPGroupManager.java:111)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.ldap.LDAPTemplate.execute(LDAPTemplate.java:44)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.ldap.LDAPGroupManager.findGroupsByUser(LDAPGroupManager.java:111)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.engine.impl.TaskQueryImpl.getGroupsForCandidateUser(TaskQueryImpl.java:477)&lt;BR /&gt;(not relevant stacktrace follows)&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the code I'm using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;/* Create default configuration */&lt;BR /&gt;ProcessEngineConfigurationImpl engineConfiguration = (ProcessEngineConfigurationImpl)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();&lt;BR /&gt;&lt;BR /&gt;/* Populate configuration */&lt;BR /&gt;LDAPConfigurator ldapConfigurator = new LDAPConfigurator();&lt;BR /&gt;ldapConfigurator.setServer("actual value was removed");&lt;BR /&gt;ldapConfigurator.setPort(10389);&lt;BR /&gt;ldapConfigurator.setUser("actual value was removed");&lt;BR /&gt;ldapConfigurator.setPassword("actual value was removed");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;ldapConfigurator.setUserBaseDn("actual value was removed");&lt;BR /&gt;ldapConfigurator.setGroupBaseDn("actual value was removed");&lt;BR /&gt;&lt;BR /&gt;ldapConfigurator.setQueryUserByUserId("actual value was removed");&lt;BR /&gt;ldapConfigurator.setQueryUserByFullNameLike("actual value was removed");&lt;BR /&gt;ldapConfigurator.setQueryGroupsForUser("actual value was removed");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;ldapConfigurator.setUserIdAttribute("actual value was removed");&lt;BR /&gt;ldapConfigurator.setUserFirstNameAttribute("actual value was removed");&lt;BR /&gt;ldapConfigurator.setUserLastNameAttribute("actual value was removed");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;ldapConfigurator.setGroupIdAttribute("actual value was removed");&lt;BR /&gt;ldapConfigurator.setGroupNameAttribute("actual value was removed");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;ldapConfigurator.setInitialContextFactory("com.sun.jndi.ldap.LdapCtxFactory");&lt;BR /&gt;ldapConfigurator.setSecurityAuthentication("simple");&lt;BR /&gt;&lt;BR /&gt;/* Build process engine */&lt;BR /&gt;engineConfiguration.getConfigurators().add(ldapConfigurator);&lt;BR /&gt;ProcessEngine processEngine = engineConfiguration.buildProcessEngine();&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;/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;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I browse the code (5.14) and found that the exception is raised at this line (LDAPQueryBuilder.java:62):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;NamingEnumeration&amp;lt; ? &amp;gt; namingEnum = initialDirContext.search(baseDn, userDnSearch, createSearchControls(ldapConfigurator));&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I'm not missing anything, the only way to have a NPE at that line is by having initialDirContext null. So, browsing up the origin of that object I arrived to LDAPConnectionUtil.createDirectoryContext:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;public static InitialDirContext createDirectoryContext(LDAPConfigurator ldapConfigurator, String principal, String credentials) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Properties properties = new Properties();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; properties.put(Context.INITIAL_CONTEXT_FACTORY, ldapConfigurator.getInitialContextFactory()); &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; properties.put(Context.PROVIDER_URL, ldapConfigurator.getServer() + ":" + ldapConfigurator.getPort());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; properties.put(Context.SECURITY_AUTHENTICATION, ldapConfigurator.getSecurityAuthentication());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; properties.put(Context.SECURITY_PRINCIPAL, principal);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; properties.put(Context.SECURITY_CREDENTIALS, credentials);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (ldapConfigurator.getCustomConnectionParameters() != null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (String customParameter : ldapConfigurator.getCustomConnectionParameters().keySet()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; properties.put(customParameter, ldapConfigurator.getCustomConnectionParameters().get(customParameter));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitialDirContext context;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; context = new InitialDirContext(properties);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (NamingException e) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new ActivitiException("Could not create InitialDirContext for LDAP connection : " + e.getMessage(), e);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return context; &lt;BR /&gt;&amp;nbsp; }&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;/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;BR /&gt;&lt;SPAN&gt;Once again, the only way to get a null InitialDirContext is by leaving that method from the catch block, but I'm not getting that exception (at least, it's not beign shown in the log).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think theres something missing when I populate the LDAPConfigurator, but I couldn't realize what it is yet. Maybe, the way I'm doing it is totally wrong and there has to be another approach to do what I'm trying to do. ¿Could please anyone tell me if I'm taking the right path or what's missing in my code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&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>Fri, 22 May 2015 15:43:28 GMT</pubDate>
    <dc:creator>matutano6</dc:creator>
    <dc:date>2015-05-22T15:43:28Z</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>

