Categories:

System functions (System Control)

SYSTEM$START_OAUTH_FLOW

启动 OAUTH 客户端流程,返回在浏览器中使用的 URL,以完成 OAuth 同意过程。

语法

SYSTEM$START_OAUTH_FLOW( '<database_name.schema_name.secret_name>' )

实参

'database_name.schema_name.secret_name'

OAuth2 密钥的名称,指定供 API 用于通过 OAuth 进行访问的身份验证信息。

使用说明

使用此函数启动一个流程,将 OAuth 刷新令牌添加到作为实参传递给此函数的密钥中。

作为中间步骤,此函数返回一个授权 URL,您可以在浏览器中使用它来完成 OAuth 同意过程。

After executing this function and using the URL it returns, immediately execute SYSTEM$FINISH_OAUTH_FLOW in the same session to have Snowflake add a refresh token to the secret you specified.

The secret in this function’s argument must include:

  • A TYPE parameter specifying a value of oauth2.
  • An API_AUTHENTICATION parameter specifying a security integration containing details (such as OAuth client ID, secret, authorization endpoint, and token endpoint) about the service provider for which access is being granted.