Skip to content

Switch SiS demo to OAuth session token auth#63

Draft
j-seuren wants to merge 3 commits intoJetBrains:mainfrom
j-seuren:j-seuren/sis-oauth-session-token-auth
Draft

Switch SiS demo to OAuth session token auth#63
j-seuren wants to merge 3 commits intoJetBrains:mainfrom
j-seuren:j-seuren/sis-oauth-session-token-auth

Conversation

@j-seuren
Copy link

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.

Draft: Pending end-to-end validation in a SiS deployment before merging.

Changes

OAuth session token authentication

Monkey-patches SnowflakeIntrospector._connect when running in SiS to use authenticator=oauth with a fresh token on every connection (avoids ~1h expiry).

Files
  • examples/demo-snowflake-project/src/databao_snowflake_demo/app.py
  • examples/demo-snowflake-project/databao/domains/root/src/snowflake.yaml

Remove service user infrastructure

Drops the service user, network policy, and user/password/account secrets from setup/cleanup SQL.

Files
  • examples/demo-snowflake-project/setup.sql
  • examples/demo-snowflake-project/cleanup.sql

Documentation update

Updates README to reflect the new auth model and note that users need USAGE grants.

Files
  • examples/demo-snowflake-project/README.md

Test Plan

  • uv run ruff check passes
  • uv run pytest tests/ -v — 65/65 pass
  • Deploy to SiS and verify OAuth token auth works end-to-end

🤖 Generated with Claude Code

j-seuren and others added 3 commits March 19, 2026 15:54
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant