Pessoal, estamos tentando implementar a função abaixo, mas não estamos obtendo sucesso, então se alguém puder dar uma força.
FUNCTION bind_ldap(out_err IN OUT VARCHAR2) RETURN VARCHAR2 IS
ldap_port VARCHAR2(256) := ‘636’;
ldap_host VARCHAR2(256) := ‘pact.punet.br’ ;
ldap_base VARCHAR2(256) := ‘OU=Teste,OU=Visitantes,DC=pact,DC=punet,DC=br;
ldap_user_admin VARCHAR2(256) := ‘CN=Usuario Controle de Acesso Wifi,OU=Genericos,DC=pact,DC=punet,DC=br;
ldap_passwd_admin VARCHAR2(256) := ‘@cess0WIFI’;
owallet_loc VARCHAR2(256);
owallet_pwd VARCHAR2(256);
retval PLS_INTEGER;
chgresult PLS_INTEGER;
my_session DBMS_LDAP.session;
emp_array DBMS_LDAP.MOD_ARRAY;
emp_dn VARCHAR2(256);
old_pwd_berval DBMS_LDAP.BERVAL_COLLECTION;
new_pwd_berval DBMS_LDAP.BERVAL_COLLECTION;
UTC_passwd RAW(400);
UTC_old_passwd RAW(400);
exception_code NUMBER;
exception_error VARCHAR2(512);
BEGIN
owallet_loc := ‘file:/your/wallet/location/ora10/’;
owallet_pwd := ‘yourwalletpassword’;
DBMS_LDAP.USE_EXCEPTION := TRUE;
——————————————————————————–
— Connect to the LDAP server
— and obtain and ld session.
——————————————————————————–
BEGIN
my_session := DBMS_LDAP.init(ldap_host,ldap_port);
EXCEPTION WHEN OTHERS THEN
out_err := ‘ERR001” ‘SQLERRM ;
END;
——————————————————————————–
— Connect to the server via SSL
——————————————————————————–
BEGIN
retval := DBMS_LDAP.OPEN_SSL(my_session, owallet_loc,owallet_pwd, 2);
EXCEPTION WHEN OTHERS THEN
out_err := ‘ERR002” ‘SQLERRM ;
END;
——————————————————————————–
— Bind to the directory as admin
——————————————————————————–
BEGIN
retval := DBMS_LDAP.simple_bind_s(my_session,ldap_user_admin, ldap_passwd_admin);
EXCEPTION WHEN OTHERS THEN
out_err := ‘ERR003” ‘SQLERRM ;
END;
——————————————————————————–
——————————————————————————–
— unbind from the directory
–retval := DBMS_LDAP.unbind_s(my_session);
RETURN my_session;
END bind_ldap;
CN=Usuario Controle de Acesso Wifi,OU=Teste, OU=Visitantes, DC=PACT,
DC=PUNET, DC=br
ERRO :ORA-31202: DBMS_LDAP: LDAP client/server error: LDAP Referral Error.
0000202B: RefErr: DSID-0310063C, data 0, 1 access points
ref 1:
‘pact.punet.br’
MPungan