Home » SQL & PL/SQL » SQL & PL/SQL » Oracle DBMS_LDAP SSL to 3rd Party LDAP Server
Oracle DBMS_LDAP SSL to 3rd Party LDAP Server [message #203553] Wed, 15 November 2006 08:56
rwhalen3
Messages: 1
Registered: November 2006
Location: Belleville, MI
Junior Member
Hey guys,

I'm trying to bind to an LDAP server from Oracle using DBMS_LDAP in SSL mode. The LDAP server is based on Microsoft's Active Directory Application Mode (ADAM).

When using non-ssl mode, I am able to connect and query the directory. However, when I try SSL mode, I am unable to connect.

The error that I get back from Oracle is:
ORA-31202: DBMS_LDAP: LDAP client/server error: Unknown authentication method
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.DBMS_LDAP", line 1455
ORA-06512: at "SYS.DBMS_LDAP", line 118
ORA-06512: at "RWHALEN3.FDS_LDAP", line 36
ORA-06512: at line 2


Here is the code I am trying to run:

CREATE OR REPLACE
PROCEDURE          fds_ldap AS

v_ldap_host         VARCHAR2(25) := '<ldapserver>';
v_ldap_port         INTEGER := 636;
v_session           SYS.DBMS_LDAP.SESSION;
v_rtn		    INTEGER := -1;
v_cdsid             VARCHAR2(20) := 'rwhalen3';
v_ldap_fieldname    VARCHAR2(20) := 'DisplayName';
v_output_name       VARCHAR2(256);
V_LDAP_BASE 	    VARCHAR2(50) := 'ou=people,o=org,c=us';
v_search   	    VARCHAR2(12);
v_dn        	    VARCHAR2(256) := 'GID=1085044, ou=Employee, ou=People, o=Org, c=US';
v_key  		    VARCHAR2(256);
v_index   	    INTEGER;
v_key_index    	    INTEGER;
i             	    INTEGER;
v_error        	    BOOLEAN := FALSE;
v_message   	    SYS.DBMS_LDAP.message;
v_result    	    SYS.DBMS_LDAP.message;
v_attrs   	    SYS.DBMS_LDAP.string_collection;
v_ber_element       SYS.DBMS_LDAP.ber_element;
v_values       	    SYS.DBMS_LDAP.STRING_COLLECTION ;

BEGIN
dbms_output.ENABLE;
      dbms_output.put_line(' Beginning LDAP test ');
      SYS.DBMS_LDAP.USE_EXCEPTION := TRUE;
      v_session 	:= SYS.DBMS_LDAP.init(v_ldap_host,v_ldap_port);
      DBMS_OUTPUT.PUT_LINE (RPAD('Ldap session ',25,' ')  || ': ' || RAWTOHEX(SUBSTR(v_session,1,8)) || '(returned from init)');
      v_rtn 	        := SYS.DBMS_LDAP.open_ssl(v_session, 'file:c:\', 'walletpassword', 2);
      -- Specifies the SSL Authentication Mode 
      -- 1 for no authentication required
      -- 2 for one way authentication required
      -- 3 for two way authentication required
      DBMS_OUTPUT.PUT_LINE (RPAD('Ldap session ',25,' ')  || ': ' || RAWTOHEX(SUBSTR(v_session,1,8)) || '(returned from init)');
      v_rtn           := SYS.DBMS_LDAP.bind_s(v_session,v_dn, 'password', 163 );
      --Authentication methods available for DBMS_LDAP.bind_s()
      --AUTH_NONE   CONSTANT NUMBER := 0;
      --AUTH_SIMPLE CONSTANT NUMBER := 128; -- context specific + primitive
      --AUTH_SASL   CONSTANT NUMBER := 163; -- v3 SASL

      DBMS_OUTPUT.PUT_LINE(RPAD('bind_s Returns ',25,' ') || ': ' || TO_CHAR(v_rtn));
        
               
--Close the LDAP connection
-- unbind from the directory
        v_rtn := SYS.DBMS_LDAP.unbind_s(v_session);
        DBMS_OUTPUT.PUT_LINE(RPAD('unbind_res Returns ',25,' ') ||  ': ' || TO_CHAR(v_rtn));        
  NULL;
END;


Any ideas??

Thanks!
Ryan
Previous Topic: NLS error with NCLOB (merged)
Next Topic: Oracle query
Goto Forum:
  


Current Time: Sat Dec 03 05:58:32 CST 2016

Total time taken to generate the page: 0.09062 seconds