Skip to contents

snowflakeauth is a toolkit for authenticating with Snowflake. It aims for compatibility with the connections.toml and config.toml files used by the Python Connector for Snowflake and the Snowflake CLI, so that R users can use a consistent approach to Snowflake credentials across both languages.

snowflakeauth is not intended for direct use by regular R users. Instead, it provides low-level utilities for R package authors targeting the Snowflake platform.

Installation

You can install the development version of snowflakeauth from GitHub with:

# install.packages("pak")
pak::pak("posit-dev/snowflakeauth")

Example

snowflakeauth can pick up on the default Snowflake connection parameters from the connections.toml and config.toml files used by the Python Connector for Snowflake and the Snowflake CLI (or any other named connection, for that matter):

or you can define the parameters of a connection manually:

snowflake_connection(
  account = "myaccount",
  user = "me",
  private_key_file = "rsa_key.p8",
  private_key_file_pwd = "supersecret"
)

snowflake_connection(
  account = "myaccount",
  user = "me",
  authenticator = "externalbrowser"
)

These parameters can then be used to retrieve credentials, which take the form of a one or more of HTTP headers:

conn <- snowflake_connection(
  account = "myaccount",
  user = "me",
  authenticator = "oauth",
  token = "token"
)

snowflake_credentials(conn)

Limitations

  • No support for SSO authentication using a browser.

  • No support for key-pair authentication with password-protected private keys.

  • No support for connection caching.

  • No support for direct username/password authentication, username/password authentication with MFA, or “Native SSO” authentication, (which is Okta-only). These are not planned; please migrate to OAuth or key-pair authentication when a browser is not available.

License

MIT (c) Posit Software, PBC