Titan Core
  • Overview
  • Getting Started
  • Working With Resources
  • Blueprint
  • GitHub Action
  • Resources
    • APIAuthenticationSecurityIntegration
    • APIIntegration
    • AccountParameter
    • AggregationPolicy
    • Alert
    • AuthenticationPolicy
    • AzureStorageIntegration
    • ComputePool
    • Database
    • DatabaseRole
    • DynamicTable
    • EmailNotificationIntegration
    • EventTable
    • ExternalAccessIntegration
    • ExternalStage
    • FailoverGroup
    • FutureGrant
    • GCSStorageIntegration
    • GenericSecret
    • GlueCatalogIntegration
    • Grant
    • GrantOnAll
    • HybridTable
    • ImageRepository
    • InternalStage
    • JSONFileFormat
    • JavascriptUDF
    • MaterializedView
    • NetworkPolicy
    • NetworkRule
    • OAuthSecret
    • ObjectStoreCatalogIntegration
    • PackagesPolicy
    • ParquetFileFormat
    • PasswordPolicy
    • PasswordSecret
    • Pipe
    • PythonStoredProcedure
    • PythonUDF
    • ReplicationGroup
    • ResourceMonitor
    • Role
    • RoleGrant
    • S3StorageIntegration
    • Schema
    • Sequence
    • Service
    • SessionPolicy
    • Share
    • SnowflakePartnerOAuthSecurityIntegration
    • SnowservicesOAuthSecurityIntegration
    • StageStream
    • Table
    • TableStream
    • Tag
    • Task
    • User
    • View
    • ViewStream
    • Warehouse
Powered by GitBook
On this page
  • Examples
  • Python
  • YAML
  • Fields
  1. Resources

OAuthSecret

PreviousNetworkRuleNextObjectStoreCatalogIntegration

Last updated 10 months ago

A Secret defines a set of sensitive data that can be used for authentication or other purposes. This class defines an OAuth secret.

Examples

Python

# OAuth with client credentials flow:
secret = OAuthSecret(
    name="some_secret",
    api_authentication="some_security_integration",
    oauth_scopes=["scope1", "scope2"],
    comment="some_comment",
    owner="SYSADMIN",
)
# OAuth with authorization code grant flow:
secret = OAuthSecret(
    name="another_secret",
    api_authentication="some_security_integration",
    oauth_refresh_token="34n;vods4nQsdg09wee4qnfvadH",
    oauth_refresh_token_expiry_time="2049-01-06 20:00:00",
    comment="some_comment",
    owner="SYSADMIN",
)

YAML

secrets:
  - name: some_secret
    secret_type: OAUTH2
    api_authentication: some_security_integration
    oauth_scopes:
      - scope1
      - scope2
    comment: some_comment
    owner: SYSADMIN
  - name: another_secret
    secret_type: OAUTH2
    api_authentication: some_security_integration
    oauth_refresh_token: 34n;vods4nQsdg09wee4qnfvadH
    oauth_refresh_token_expiry_time: 2049-01-06 20:00:00
    comment: some_comment
    owner: SYSADMIN

Fields

  • name (string, required) - The name of the secret.

  • api_authentication (string) - The security integration name for API authentication.

  • oauth_scopes (list) - The OAuth scopes for the secret.

  • oauth_refresh_token (string) - The OAuth refresh token.

  • oauth_refresh_token_expiry_time (string) - The expiry time of the OAuth refresh token.

  • comment (string) - A comment for the secret.

owner (string or ) - The owner of the secret. Defaults to SYSADMIN.

Snowflake Documentation
Role