Skip to content

Commit

Permalink
Merge pull request #163 from oracle/fix/external_auth
Browse files Browse the repository at this point in the history
Added support for external auth
  • Loading branch information
aosingh authored Jan 15, 2025
2 parents 8d01355 + f489eb0 commit 4912ca3
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions dbt/adapters/oracle/connections.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (c) 2023, Oracle and/or its affiliates.
Copyright (c) 2025, Oracle and/or its affiliates.
Copyright (c) 2020, Vitor Avancini
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -208,11 +208,19 @@ def open(cls, connection):
logger.debug(f"Attempting to connect using Oracle method: '{method}' "
f"and dsn: '{dsn}'")

conn_config = {
'user': credentials.user,
'password': credentials.password,
'dsn': dsn
}
if credentials.password is None:
logger.debug("Password not supplied. "
"Using external authentication")
conn_config = {
'externalauth': True,
'dsn': dsn
}
else:
conn_config = {
'user': credentials.user,
'password': credentials.password,
'dsn': dsn
}

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

0 comments on commit 4912ca3

Please sign in to comment.