Skip to content

Commit 2337b5d

Browse files
Merge pull request #21 from cloudsufi/OAuth-issue-fix
[PLUGIN-1731]Added fix for Oauth
2 parents 13a03be + 8666740 commit 2337b5d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/io/cdap/plugin/snowflake/common/client/SnowflakeAccessor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ private void initDataSource(SnowflakeBasicDataSource dataSource, BaseSnowflakeCo
111111
if (config.getOauth2Enabled()) {
112112
String accessToken = OAuthUtil.getAccessTokenByRefreshToken(HttpClients.createDefault(), config);
113113
dataSource.setOauthToken(accessToken);
114+
// The recommend way to pass token is in the password when you use the driver with connection pool.
115+
// This is also a mandatory field, so adding the same.
116+
// Refer https://github.com/snowflakedb/snowflake-jdbc/issues/1175
117+
dataSource.setPassword(accessToken);
114118
} else if (config.getKeyPairEnabled()) {
115119
dataSource.setUser(config.getUsername());
116120

0 commit comments

Comments
 (0)