Applies to
- Liquibase Pro
- Liquibase Open Source (Community)
Conditions
- Any version of Liquibase Pro or Liquibase Open Source
- Snowflake
Question
Can Liquibase Connect to Snowflake using an OAuth token?
Answer
Liquibase doesn’t handle authentication directly; it relies on the database driver to manage authentication. However, connecting with an OAuth token to Snowflake is possible through the correct configuration. For guidance on setting up OAuth tokens with Snowflake, please refer to the Snowflake documentation: How to configure Azure to issue OAuth tokens on behalf of a client to access Snowflake.
Using the token with Liqubiase
Once you have a valid OAuth token, you can use it to connect to Snowflake in two ways.
Setting the token via the JDBC URL
You can pass the token in the JDBC URL by using the token attribute in the URL
jdbc:snowflake://<account_ID>.snowflakecomputing.com/?authenticator=oauth&token=<token_value>
When providing the token in the URL, do not wrap the token itself in quotes.
Setting the token via the password
You can set the password Liquibase passes to Snowflake to the token value. In this setting, you will need to set the username to the client ID that is set for the OAuth token.
jdbc:snowflake://<account_ID>.snowflakecomputing.com/?authenticator=oauth&token=<token_value>
Note:
- When connecting via OAuth, default properties for the profile, such as the warehouse, database, and schema, will automatically be picked up. However, if a default is not set, you will still need to set them, which can be done either through the scripts or URL.
- When these are provided/set in Liquibase, the log will show null values where it expects to see information like username, schema, etc.
Related Article(s)
N/A
Comments
0 comments
Article is closed for comments.