snowflake.snowpark.secrets.get_oauth_access_token

snowflake.snowpark.secrets.get_oauth_access_token(secret_name: str) str[source]

Get an OAuth2 access token from Snowflake. .. note:: Require a Snowflake environment with OAuth secrets configured

Returns:

The OAuth2 access token as a string.

Raises:
  • NotImplementedError – If running outside Snowflake server or SPCS environment.

  • ValueError – If the secret does not exist or is not authorized (SPCS only).