macwadu
macwadu

Reputation: 907

Connecting to LDAP in oracle using sAMAccountName

i was trying to use DBMS_LDAP to connect to a ldap server to do authentication.

My question is:

Is it possible to use sAMAccountName to connect to the LDAP server? I'm getting the connection with the full name but wanted to do with the sAMAccountName but don't know how, i think DBMS_LDAP.bind_s and DBMS_LDAP.simple_bind_s don't permit the use of sAMAccountName.

Thanks

Upvotes: 1

Views: 2056

Answers (1)

Vincent Malgrat
Vincent Malgrat

Reputation: 67722

I've been able to use bind_s and simple_bind_s directly with the sAMAccountName by prefixing it with the domain name:

l_res := DBMS_LDAP.simple_bind_s(ld => l_session,
                                 dn => l_domain || '\' || l_account_name,
                                 passwd => l_password)

I tried to find additional information or reference in the Oracle documentation but I couldn't find anything on how to build the dn parameter. This seems to dependent upon the configuration of the AD server. In some settings, such as described in this OTN forum post, it seems to be possible to authenticate with %LDAP_USER%@ourdomain.com.

Upvotes: 1

Related Questions