Safeguard
Developer Tools•

Snowflake Python connector: which auth options suit pipelines?

A decision guide to the Snowflake Python connector's documented authentication methods and which fit unattended pipelines, with secrets handling tips.

Safeguard Security Team
3 min read

The Snowflake Python connector documents username and password, connection profiles, SSO, MFA, key pair, OAuth, workload identity federation and programmatic access tokens. For unattended pipelines, methods without a stored long lived password, such as key pair, OAuth or workload identity, fit better than a shared password.

The documented options

MethodHow it works in the docsFit for unattended jobs
Username and passwordPass user, password and account; can come from environment variables or a config filePossible, but a long lived secret
connections.tomlNamed profiles hold credentials and settingsConvenient; protect the file
SSOAvailable if Snowflake is configured for itInteractive by nature
MFADuo push, passcode, or token cachingInteractive; caching is on by default
Key pairSet the authenticator to the JWT type and supply a private key fileGood for service accounts
OAuthToken, or authorization code or client credentials flowsGood where an identity provider exists
Workload identity federationShort lived credentials from AWS, Azure, GCP or OIDCStrong fit: no stored long lived secret
Programmatic access tokenNeeds the feature enabled for the accountNon interactive

Reading the table for a pipeline

A scheduled dbt or Airflow job has no human to approve a push or type a code. That rules out interactive methods. Of the rest, the docs describe workload identity federation as obtaining short lived credentials from the platform's identity provider, so no long lived secrets are stored. That removes the most common leak: a password in a repo, image or log.

Secrets handling

The docs recommend reading credentials from environment variables or configuration files instead of embedding them in code. Go a step further:

  1. Fetch at run time from your secrets manager, not at build time.
  2. Keep key files out of images and mount them as secrets.
  3. Use one identity per pipeline, so access and revocation are targeted.
  4. Grant the narrowest role. See warehouse role design.
  5. Log the identity of each connection for audit logging on warehouse access.
  6. Rotate keys on a schedule and when staff change.

A few details to watch

Token caching for MFA, SSO and OAuth is on unless you turn it off, according to the docs. On a shared machine, decide whether you want cached tokens. Some older parameter names are deprecated and emit warnings, so read warnings in your logs during upgrades.

Checking the connector itself

The connector is a dependency like any other. Pin its version, and track advisories for it and for its own dependencies. See Python dependency pinning in data projects and the Airflow provider advisories for how connector issues surface.

Quick check

Is key pair authentication better than a password for a job?

It avoids sending a password and suits service accounts, but the private key is still a secret. Store and rotate it carefully.

Can I hard code credentials for a quick test?

The docs advise using environment variables or configuration files instead of embedding credentials in code.

Safeguard scans the connectors and libraries your pipelines import, with a free scan at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.