Skip to content

More Snowflake Auth Methods - #318

Open
mattsenicksigma wants to merge 7 commits into
Kaelio:mainfrom
mattsenicksigma:feature/snowflake-oauth
Open

More Snowflake Auth Methods#318
mattsenicksigma wants to merge 7 commits into
Kaelio:mainfrom
mattsenicksigma:feature/snowflake-oauth

Conversation

@mattsenicksigma

Copy link
Copy Markdown
Contributor

Summary

Adds three new authentication methods to the Snowflake connector alongside the existing password and RSA key pair paths:

  • OAuth token (authMethod: oauth) — accepts a short-lived OAuth bearer token via token_ref: env:VAR or token: literal. Username is optional; the token carries identity. Uses authenticator: 'OAUTH' in the Snowflake SDK.
  • Programmatic access token (authMethod: pat) — accepts a Snowflake-issued long-lived PAT via token_ref. Suitable for headless and CI environments where browser interaction is not available. Uses authenticator: 'PROGRAMMATIC_ACCESS_TOKEN'.
  • Browser SSO (authMethod: externalbrowser) — opens the system browser for SAML/SSO login. Username is optional so the IDP resolves identity without a login hint. Uses authenticator: 'EXTERNALBROWSER'.

Username validation is tightened: it is now only required for password and rsa auth. The three new methods treat username as optional.

token_ref follows the same env:VAR / file:/path reference syntax used by other secret fields throughout ktx.

Docs updated in docs-site/content/docs/integrations/primary-sources.mdx to cover all five auth methods with examples.

Test plan

  • Unit tests for all three new auth methods (token resolution, missing-token error, optional username) — 21 connector tests pass
  • authMethod: externalbrowser tested interactively against a live Snowflake account via ktx connection test
  • authMethod: pat requires generating a PAT from the Snowflake account settings page, then verifying ktx connection test succeeds with token_ref: env:SNOWFLAKE_PAT
  • authMethod: oauth requires a valid short-lived OAuth bearer token; verify ktx connection test accepts it via token_ref
  • Existing password and RSA auth paths unaffected — confirm username-required validation still throws for those methods

🤖 Generated with Claude Code

mattsenicksigma and others added 2 commits June 27, 2026 00:07
Adds authMethod: oauth to the Snowflake connector alongside the existing
password and rsa methods. An OAuth access token is supplied via token_ref
(env: or file: reference) or a literal token field, and is passed to the
Snowflake SDK as authenticator: OAUTH. username is optional for OAuth
since the token carries identity, but is accepted when the account
requires it. Docs and five new config-resolution tests included.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extends the Snowflake connector with two additional authentication paths:
- `authMethod: pat` — programmatic access token via PROGRAMMATIC_ACCESS_TOKEN
  authenticator, suitable for headless and CI environments
- `authMethod: externalbrowser` — SSO browser popup via EXTERNALBROWSER
  authenticator, username now optional so IDP resolves identity

Username is now only required for password and RSA auth; oauth, pat, and
externalbrowser all treat it as optional.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@mattsenicksigma is attempting to deploy a commit to the Kaelio Team on Vercel.

A member of the Team first needs to authorize it.

@mattsenicksigma

mattsenicksigma commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

More Human Comment

Basically just providing more ways to provide Snowflake Auth. I don't have access to privileges in an instance to generate a PAT, so that one will need a quick manual test. externalbrowser and oauth are nice utility auth methods for dev and was able to test those in my instance.

I'm pretty sure that Snowflake is deprecating password auth as well, so will help users who are on password auth migrate.

@luca-martial

Copy link
Copy Markdown
Contributor

Thanks @mattsenicksigma ! We had a user request this recently so this is timely

@luca-martial
luca-martial requested a review from andreybavt June 27, 2026 17:20
@luca-martial

Copy link
Copy Markdown
Contributor

@Daniel-Wiszowaty feel free to test this out

@andreybavt andreybavt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left a few inline comments

Comment thread packages/cli/src/connectors/snowflake/connector.ts Outdated
Comment thread docs-site/content/docs/integrations/primary-sources.mdx Outdated
Comment thread docs-site/content/docs/integrations/primary-sources.mdx Outdated
Comment thread packages/cli/src/connectors/snowflake/connector.ts
Comment thread packages/cli/src/connectors/snowflake/connector.ts Outdated
Comment thread packages/cli/src/connectors/snowflake/connector.ts
@mattsenicksigma

Copy link
Copy Markdown
Contributor Author

made some updates here, mainly:

  • get rid of the token_ref concept, only ever use token from the ktx.yaml
  • update setup wizard to hopefully support all 5 auth methods
  • updated connection policies

@mattsenicksigma

Copy link
Copy Markdown
Contributor Author

@andreybavt lmk if anything further needed on this one, hoping to attach snowflake to a ktx instance I am playing around with

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.

3 participants