How can I authenticate a user in LDAP within multiple OU with variable levels in APEX?
<p>I'm having a few problems trying to implement a LDAP authentication scheme in Oracle APEX. As an example I will post my DN here </p>

<blockquote>
  <p><code>CN=MyUsername,OU=Users,OU=MyDepartment,OU=MyManagementUnit,OU=MyDirectiveUnit,OU=MyLocation,OU=MyCompany,DC=example,DC=com</code></p>
</blockquote>

<p>.</p>

<p>From this data, the only constants for what I want to accomplish are <code>CN=MyUsername,OU=Users ... OU=MyLocation,OU=MyCompany,DC=example,DC=com</code>, while these <code>OU=MyDepartment, OU=MyManagementUnit, OU=MyDirectiveUnit</code> can change from user to user.</p>

<p>In the Apex Authentication Scheme I have the following values:</p>

<ul>
<li><strong>LDAP Host</strong>: <code>example.com</code></li>
<li><strong>Port</strong>: <code>default</code></li>
<li><strong>Use SSL</strong>: <code>No</code></li>
<li><strong>Use Exact Distinguished Name (DN)</strong>: <code>No</code></li>
<li><strong>DN String</strong>: <code>OU=MyLocation,OU=MyCompany,DC=example,DC=com</code></li>
<li><strong>Search filter</strong>: <code>(cn=%LDAP_USER%)(&amp;(objectClass=user)(|(OU=*)(OU=*)))</code> and <code>(cn=%LDAP_USER%)(&amp;(objectClass=user)(OU=*,OU=*,OU=*)</code> have been my most recent tries.</li>
</ul>

<p>After everything, I keep getting this error message: </p>

<blockquote>
  <p>Authentication failed ORA-31202: DBMS_LDAP: LDAP client/server error:
  Operations error. 000004DC: LdapErr: DSID-0C0906E8, comment: In order
  to perform this operation a successful bind must be completed on the
  connection., data 0, v1db1</p>
</blockquote>

<p>I've read a bit these past few days about Active Directory but I am unable to understand it fully (at least with big multi-level, multi-groups trees). Any tips and/or suggestions are welcome.</p>