Skip to content

Commit 4912ca3

Browse files
authored
Merge pull request #163 from oracle/fix/external_auth
Added support for external auth
2 parents 8d01355 + f489eb0 commit 4912ca3

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

dbt/adapters/oracle/connections.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2023, Oracle and/or its affiliates.
2+
Copyright (c) 2025, Oracle and/or its affiliates.
33
Copyright (c) 2020, Vitor Avancini
44
55
Licensed under the Apache License, Version 2.0 (the "License");
@@ -208,11 +208,19 @@ def open(cls, connection):
208208
logger.debug(f"Attempting to connect using Oracle method: '{method}' "
209209
f"and dsn: '{dsn}'")
210210

211-
conn_config = {
212-
'user': credentials.user,
213-
'password': credentials.password,
214-
'dsn': dsn
215-
}
211+
if credentials.password is None:
212+
logger.debug("Password not supplied. "
213+
"Using external authentication")
214+
conn_config = {
215+
'externalauth': True,
216+
'dsn': dsn
217+
}
218+
else:
219+
conn_config = {
220+
'user': credentials.user,
221+
'password': credentials.password,
222+
'dsn': dsn
223+
}
216224

217225
if oracledb.__name__ == "oracledb":
218226
conn_config['connection_id_prefix'] = f'dbt-oracle-{dbt_version}-'

0 commit comments

Comments
 (0)