Switch SiS demo to OAuth session token auth#63
Draft
j-seuren wants to merge 3 commits intoJetBrains:mainfrom
Draft
Switch SiS demo to OAuth session token auth#63j-seuren wants to merge 3 commits intoJetBrains:mainfrom
j-seuren wants to merge 3 commits intoJetBrains:mainfrom
Conversation
Replace password-based service user authentication with OAuth session token auth in the Streamlit-in-Snowflake demo. The app now reads the SPCS-provided token from /snowflake/session/token on every connection, authenticating as the logged-in Snowflake user. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The YAML now includes `authenticator: externalbrowser` so local dev works out of the box with Snowflake SSO. In SiS, the monkey-patch overrides this with OAuth token auth. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Switch the Snowflake demo from password-based service user auth to OAuth session token auth in Streamlit-in-Snowflake. The app now authenticates as the logged-in user by reading the SPCS-provided token from
/snowflake/session/token, eliminating stored credentials.Changes
OAuth session token authentication
Monkey-patches
SnowflakeIntrospector._connectwhen running in SiS to useauthenticator=oauthwith a fresh token on every connection (avoids ~1h expiry).Files
examples/demo-snowflake-project/src/databao_snowflake_demo/app.pyexamples/demo-snowflake-project/databao/domains/root/src/snowflake.yamlRemove service user infrastructure
Drops the service user, network policy, and user/password/account secrets from setup/cleanup SQL.
Files
examples/demo-snowflake-project/setup.sqlexamples/demo-snowflake-project/cleanup.sqlDocumentation update
Updates README to reflect the new auth model and note that users need USAGE grants.
Files
examples/demo-snowflake-project/README.mdTest Plan
uv run ruff checkpassesuv run pytest tests/ -v— 65/65 pass🤖 Generated with Claude Code