Skip to content

Commit 577cf38

Browse files
authored
Allow overriding snowflake authenticator parameter
Set default username_password_mfa authenticator option only if the custom URL is not provided by the user. This allows overriding it with custom value like 'externalbrowser'. Additionally, we skip asking about the password if --password flag is not provided to allow using passwordless auth options.
1 parent 2491ad1 commit 577cf38

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

dumper/app/src/main/java/com/google/edwmigration/dumper/application/dumper/connector/snowflake/AbstractSnowflakeConnector.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,13 @@ private DataSource createUserPasswordDataSource(@Nonnull ConnectorArguments argu
120120
Properties prop = new Properties();
121121

122122
prop.put("user", arguments.getUser());
123-
prop.put("password", arguments.getPasswordOrPrompt());
124-
prop.put("authenticator", "username_password_mfa");
123+
if (arguments.isPasswordFlagProvided()) {
124+
prop.put("password", arguments.getPasswordOrPrompt());
125+
}
126+
// Set default authenticator only if url is not provided to allow user overriding it
127+
if (arguments.getUri() == null) {
128+
prop.put("authenticator", "username_password_mfa");
129+
}
125130
return new SimpleDriverDataSource(driver, url, prop);
126131
}
127132

0 commit comments

Comments
 (0)