You might have to connect with LDAP owner and then look at specific elements
Regards
Amin Adatia ([Email address protected]
KnowTech Solutions Inc. (www.knowtech.ca)
(613) 226-8378 Mobile (613) 864-8378
----- Original Message -----
From: "Amit" <oracledba-ezmlmshield-x96658216.[Email address protected]
To: "LazyDBA Discussion" <[Email address protected]
Sent: Thursday, December 27, 2007 5:24 AM
Subject: pl/sql authenicate with active directory
> declare
> l_retval pls_integer;
> l_retval2 pls_integer;
> l_session dbms_ldap.session;
> l_ldap_host varchar2(256);
> l_ldap_port varchar2(256);
> l_ldap_user varchar2(256) := 'XXXXX';
> l_ldap_passwd varchar2(256) := 'XXXXX';
> l_ldap_base varchar2(256);
> begin
> l_retval := -1;
> dbms_ldap.use_exception := TRUE;
> l_ldap_host := 'XXXX.com';
> l_ldap_port := '389';
> l_ldap_user :=
> 'cn='||l_ldap_user||',cn=Users,dc=XXX,dc=com';
>
> l_session := dbms_ldap.init( l_ldap_host, l_ldap_port );
> l_retval := dbms_ldap.simple_bind_s( l_session, l_ldap_user,
> l_ldap_passwd );
> dbms_output.put_line( 'Return value: ' || l_retval );
> l_retval2 := dbms_ldap.unbind_s( l_session );
>
> exception when others
>
> then
> dbms_output.put_line (rpad('ldap session ',25,' ') ||
> ': ' ||
> rawtohex(substr(l_session,1,8)) ||
> '(returned from init)');
> dbms_output.put_line( 'error: ' || sqlerrm||' '||sqlcode
> );
> dbms_output.put_line( 'user: ' || l_ldap_user );
>
> dbms_output.put_line( 'host: ' || l_ldap_host );
> dbms_output.put_line( 'port: ' || l_ldap_port );
> l_retval := dbms_ldap.unbind_s( l_session );
> end;
>
> this code works well for authentication but I need to enter full name
> for username I am unable to authenticate with nickname like joem instead
> of joe marks. But I tried with windows domain name /nickname its fail to
> authenticate also....
>
> Anyone has solutions to fetch records of user and to authenticate with
> nickname means with samaccount
>
>
> DISCLAIMER:
> This message contains privileged and confidential information and is
> intended only for an individual named. If you are not the intended
> recipient, you should not disseminate, distribute, store, print, copy or
> deliver this message. Please notify the sender immediately by e-mail if
> you have received this e-mail by mistake and delete this e-mail from your
> system. E-mail transmission cannot be guaranteed to be secure or
> error-free as information could be intercepted, corrupted, lost,
> destroyed, arrive late or incomplete or contain viruses. The sender,
> therefore, does not accept liability for any errors or omissions in the
> contents of this message which arise as a result of e-mail transmission.
> If verification is required, please request a hard-copy version.
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
Oracle LazyDBA home page