Skip to content

fix: re-authenticate when the cached SSO ID token has expired - #2

Open
carladev wants to merge 1 commit into
runnerty:mainfrom
carladev:feat/expired-id-token-reauth
Open

fix: re-authenticate when the cached SSO ID token has expired#2
carladev wants to merge 1 commit into
runnerty:mainfrom
carladev:feat/expired-id-token-reauth

Conversation

@carladev

Copy link
Copy Markdown
Contributor

No description provided.

With external browser authentication the driver caches an ID token
(clientStoreTemporaryCredential) so the browser is opened only once. When that
token expires the driver keeps sending it instead of starting a new
authentication, so every process fails with:

  Snowflake connection error: The provided ID Token is invalid.

and the only way out was removing the credential cache file by hand.

The executor now detects that failure (GS error 390195 / "ID Token is invalid"),
removes the cached ID token and retries the connection once, which starts a new
browser authentication. A warning is logged in the Runnerty output:

  warn: execute-snowflake: The cached SSO ID token has expired. Removed it and
  re-authenticating through the browser...

Re-authentication is shared between the processes of an execution: when a chain
runs several Snowflake processes in parallel they all fail at the same time, and
without coordination each one would open its own browser window and the extra
ones would die with "Browser action timed out". Only the first process
authenticates, the rest wait for it and reuse the newly cached token.

Only the external browser flow is affected: any other connection error, and the
OAuth token flow, keep the previous behaviour. The snowflake-sdk internals used
to drop the cached credential are required lazily so a future change in the
driver cannot prevent the executor from loading.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@carladev
carladev force-pushed the feat/expired-id-token-reauth branch from 055e9bd to e3fdbf3 Compare July 30, 2026 11:09
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