Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX_LDAP Auhtenticate - Bad search Filter

jstem1177Feb 7 2014 — edited Feb 14 2014

Hello All,

I've gone through a tone of tests and still cannot figure this out. I checkout all the following threads to no avail. As mentioned in these thread, the LDAP tree is setup such that the are spaces between First Name and Last name, and not all users are in the the same tree.

MS Active Directory authentication

http://community.oracle.com/thread/2619306

Instead of writting up a large LDAP package, my approach was to then try  apex_custom_auth.ldap_authenticate on APEX 4.2.4, and I'm tring to go for the samAccountName which is the actual "Windows Login"

I've turned on debug in APEX and I'm running this in my SQL command window.However I'm always getting bad search.

DECLARE
l_result boolean;
l_out varchar2(5);
BEGIN
  APEX_DEBUG.ENABLE(9); 
  l_result := apex_custom_auth.ldap_authenticate ( 
      p_username => 'jans', 
      p_password => 'MYPASSWD', 
      p_ldap_host => '192.168.2.100', 
      p_ldap_port => 389, 
      p_use_exact_dn=>'N', 
      p_ldap_string=>'OU=Users,OU=MyCompany,DC=mydomain,DC=local', 
      p_search_filter=>'(&(objectClass=user)(samAccountName=%LDAP_USER%))', 
      p_ldap_edit_function => null, 
      p_owner => null ); 

    l_out := CASE WHEN l_result THEN 'TRUE' ELSE 'FALSE' END;
    htp.p(l_out);
END;

authenticate p_dn=>OU=Users,OU=MyCompany,DC=mydomain,DC=local,p_search_filter=>,p_password=>...,p_ldap_host=>192.168.2.100,p_ldap_port=>389,p_use_ssl=>N,p_use_exact_dn=>N

...dbms_ldap.search_s p_dn=>OU=MyCompany,DC=mydomain,DC=local, l_filter=>()

error:ORA-31202: DBMS_LDAP: LDAP client/server error: Bad search filter, backtrace:ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86

ORA-06512: at "SYS.DBMS_LDAP", line 1489

ORA-06512: at "SYS.DBMS_LDAP", line 234

ORA-06512: at "APEX_040200.WWV_FLOW_CUSTOM_AUTH_LDAP", line 71

Thanks in Advance for any asistance and thoughts. Also, I was curious to know, where or not one needs any Admin privilege to start searching through a tree?

Jan S.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 14 2014
Added on Feb 7 2014
5 comments
4,138 views