snowflake.snowpark.secrets.get_oauth_access_token

snowflake.snowpark.secrets.get_oauth_access_token(secret_name: str) str[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.43.0/src/snowflake/snowpark/secrets.py#L212-L222)

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).

语言: 中文