From d8d11a57248ff30478169b140ccaed43e7674850 Mon Sep 17 00:00:00 2001 From: Sterling Paramore Date: Tue, 13 Sep 2022 16:31:36 -0700 Subject: [PATCH] Adds support for MFA token caching Will work even if user does not use MFA. --- setup.py | 2 +- target_snowflake/db_sync.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 36e848b5..adc21796 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ python_requires='>=3.7', install_requires=[ 'pipelinewise-singer-python==1.*', - 'snowflake-connector-python[pandas]==2.7.*', + 'snowflake-connector-python[secure-local-storage,pandas]==2.7.*', 'inflection==0.5.1', 'joblib==1.1.0', 'boto3==1.23.10', diff --git a/target_snowflake/db_sync.py b/target_snowflake/db_sync.py index ffac46c5..0d312a62 100644 --- a/target_snowflake/db_sync.py +++ b/target_snowflake/db_sync.py @@ -299,6 +299,9 @@ def open_connection(self): warehouse=self.connection_config['warehouse'], role=self.connection_config.get('role', None), autocommit=True, + authenticator='username_password_mfa', + client_store_temporary_credential=True, + client_request_mfa_token=True, session_parameters={ # Quoted identifiers should be case sensitive 'QUOTED_IDENTIFIERS_IGNORE_CASE': 'FALSE',