Skip to content

Conversation

@mohamedmeqlad99
Copy link

Description

Added support for automatic OAuth token authentication when running inside Snowpark Container Services. This change enables dlt to:

  • Auto-detect OAuth token from /snowflake/session/token
  • Use SNOWFLAKE_HOST and SNOWFLAKE_ACCOUNT environment variables
  • Support token-based auth without requiring username
  • Maintain backward compatibility with existing auth methods

Changes include:

  • Updated SnowflakeCredentials class
  • Added comprehensive test coverage
  • Updated Snowflake configuration documentation

Related Issues

Additional Context

Testing:

  • Added unit tests in test_snowflake_snowpark_token.py
  • Verified auto-detection works as expected
  • Confirmed explicit credentials take precedence
  • Validated connector parameter generation

Documentation:

  • Added new section for Snowpark Container Services auth
  • Included usage examples and override instructions

@netlify
Copy link

netlify bot commented Aug 9, 2025

Deploy Preview for dlt-hub-docs ready!

Name Link
🔨 Latest commit 5481857
🔍 Latest deploy log https://app.netlify.com/projects/dlt-hub-docs/deploys/6896d04c8220da000834a227
😎 Deploy Preview https://deploy-preview-2984--dlt-hub-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@zilto zilto added destination Issue with a specific destination credentials Issue with configuration and authentication labels Aug 9, 2025
Copy link
Collaborator

@burnash burnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @mohamedmeqlad99 please address the comment below. To use the token-only auth you'd need to actually actively probe for the type of token, e.g. (os.path.exists("/snowflake/session/token")) see https://docs.snowflake.com/en/developer-guide/snowpark-container-services/additional-considerations-services-jobs#connecting-with-a-snowflake-provided-oauth-token

Also please fix linting to ensure the our CI pass. Run make lint to see where it fails.

database=self.database,
)
# Remove user/password when using token auth
conn_params.pop("user", None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@burnash burnash added the question Further information is requested label Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

credentials Issue with configuration and authentication destination Issue with a specific destination question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Snowflake-provided OAuth token in Snowpark Container Services

3 participants