Skip to content

How to connect to remote oracle database through LDAP ? #1212

@Chandra01B

Description

@Chandra01B

Problem : I am trying to connect to remote Oracle Database through LDAP on Windows 10 machine. But node-oracledb driver doesn't recognize below connection string format.

connectString: "ldap://[ldap server name]:port/[service name],[ldap context]"

I also tried few other ldap formats. But here is the error I am getting.

Error: ORA-12538: TNS: no such protocol adapter

I am able to connect to a remote oracle database through LDAP from SQL Developer with following JDBC URL format:

jdbc:oracle:thin:@ldap://[LDAP Server]:[port]/[DB Service Name],[LDAP context]

Also checked this link. Setup seems to be fairly complicated and hard to understand.
https://stackoverflow.com/questions/31994159/how-do-you-connect-to-an-ldap-server-using-node-oracledb

Lot of changes occurred since then and new versions have been released.Is there a simpler set up to make node-oracledb to talk to ldap ?

I did try setting up ldap.ora and sqlnet.ora and placed them in $oracle_instant_client_home\network\admin directory. But I am not sure what to pass for connectString in db-config.js ?

sqlnet.ora :

# sqlnet.ora
# Place this file in the network/admin subdirectory or your 
# $ORACLE_HOME location.
NAMES.DIRECTORY_PATH = (LDAP)

ldap.ora

# ldap.ora
# Place this file in the network/admin subdirectory or your 
# $ORACLE_HOME location.
DIRECTORY_SERVERS = (your-server.your-organization:389:636)
DEFAULT_ADMIN_CONTEXT = "ldap-ou-designation"
DIRECTORY_SERVER_TYPE = ad

Node.js version : 10.15
Oracle Instant Client version: Instant Client Win64 19.5
node-oracledb : 3.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions