| Title: | Authentication Helpers for 'Snowflake' |
|---|---|
| Description: | Authentication helpers for 'Snowflake'. It provides compatibility with authentication approaches supported by the 'Snowflake Connector for Python' <https://pypi.org/project/snowflake-connector-python> and the 'Snowflake CLI' <https://pypi.org/project/snowflake-cli>. |
| Authors: | Aaron Jacobs [aut], E. David Aja [aut, cre], Posit Software, PBC [cph, fnd] |
| Maintainer: | E. David Aja <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.2.9000 |
| Built: | 2026-05-18 18:08:34 UTC |
| Source: | https://github.com/posit-dev/snowflakeauth |
Reports whether a default connection is available
has_a_default_connection(...)has_a_default_connection(...)
... |
arguments passed to |
Logical value indicating whether a default connection is available.
has_a_default_connection()has_a_default_connection()
Reads Snowflake connection parameters from the connections.toml and
config.toml files used by the Snowflake Connector for Python
and the Snowflake CLI,
or specifies them for a connection manually.
snowflake_connection(name = NULL, ..., .config_dir = NULL, .verbose = FALSE)snowflake_connection(name = NULL, ..., .config_dir = NULL, .verbose = FALSE)
name |
A named connection. Defaults to
|
... |
Additional connection parameters. See Common parameters. |
.config_dir |
The directory to search for a |
.verbose |
Logical; if |
An object of class "snowflake_connection".
The following is a list of common connection parameters. A more complete list can be found in the documentation for the Snowflake Connector for Python:
account: A Snowflake account identifier.
host: An optional hostname for the Snowflake endpoint. When provided,
this is used instead of the default {account}.snowflakecomputing.com.
Useful for private endpoints or non-standard deployments.
user: A Snowflake username.
role: The role to use for the connection.
schema: The default schema to use for the connection.
database: The default database to use for the connection.
warehouse: The default warehouse to use for the connection.
authenticator: The authentication method to use for the connection.
private_key or private_key_file: A path to a PEM-encoded private key
for key-pair authentication.
private_key_file_pwd: The passphrase for the private key, if any.
token: The OAuth token to use for authentication.
token_file_path: A path to an OAuth token to use for authentication.
password: The user's Snowflake password.
# Read the default connection parameters from an existing # connections.toml file: conn <- snowflake_connection() # Read a named connection from an existing connections.toml file: conn <- snowflake_connection(name = "default") # Override specific parameters for a connection: conn <- snowflake_connection( schema = "myschema", warehouse = "mywarehouse" ) # Pass connection parameters manually, which is useful if there is no # connections.toml file. For example, to use key-pair authentication: conn <- snowflake_connection( account = "myaccount", user = "me", private_key = "rsa_key.p8" )# Read the default connection parameters from an existing # connections.toml file: conn <- snowflake_connection() # Read a named connection from an existing connections.toml file: conn <- snowflake_connection(name = "default") # Override specific parameters for a connection: conn <- snowflake_connection( schema = "myschema", warehouse = "mywarehouse" ) # Pass connection parameters manually, which is useful if there is no # connections.toml file. For example, to use key-pair authentication: conn <- snowflake_connection( account = "myaccount", user = "me", private_key = "rsa_key.p8" )
Get credentials for a Snowflake connection
snowflake_credentials(params, role = NULL, spcs_endpoint = NULL, ...)snowflake_credentials(params, role = NULL, spcs_endpoint = NULL, ...)
params |
a list of connection parameters from ' |
role |
a snowflake entity |
spcs_endpoint |
a Snowpark Container Services ingress URL, formatted (*-accountname.snowflakecomputing.app) |
... |
Additional Snowflake connection parameters |
A list of HTTP headers.
# Obtain authentication headers for accessing Snowflake APIs snowflake_credentials( snowflake_connection() ) # If the application is in Snowpark Container Services, # a different collection of headers are returned: snowflake_credentials( snowflake_connection(), spcs_endpoint = "https://example-accountname.snowflakecomputing.app" )# Obtain authentication headers for accessing Snowflake APIs snowflake_credentials( snowflake_connection() ) # If the application is in Snowpark Container Services, # a different collection of headers are returned: snowflake_credentials( snowflake_connection(), spcs_endpoint = "https://example-accountname.snowflakecomputing.app" )