...
Excerpt | ||||
---|---|---|---|---|
Configure the
|
...
- Login to the Snowflake console as an account admin.
- Click Worksheets.
- For your role, select ACCOUNTADMIN.
Paste the following command in the worksheet and modify its parameters:
Code Block CREATE [ OR REPLACE ] SECURITY INTEGRATION [IF NOT EXISTS] <NAME> TYPE = OAUTH OAUTH_CLIENT = CUSTOM OAUTH_CLIENT_TYPE = 'CONFIDENTIAL' OAUTH_REDIRECT_URI = '<URI>' ENABLED = TRUE OAUTH_ALLOW_NON_TLS_REDIRECT_URI = FALSE [PRE_AUTHORIZED_ROLES_LIST = ( '<role_name_1>' [ , '<role_name_2>' , ... ]) ] [ BLOCKED_ROLES_LIST = ( '<role_name_3>' [ , '<role_name_4>' , ... ] ) ] OAUTH_ISSUE_REFRESH_TOKENS = TRUE OAUTH_REFRESH_TOKEN_VALIDITY = 7776000 (90 Days) [ NETWORK_POLICY = '<network_policy>'] [ COMMENT = '<Description of your Integration>' ]
Parameter Description <NAME> Name of the integration. Example: OAuth 2.0 Client
<URI> Callback URI of the
.D s platform https://cloud.trifacta.com/oauth2/Code Block D s deployment url type callback PRE_AUTHORIZED_ROLES_LIST A comma-separated list of Snowflake roles that do not need user consent when accessing Snowflake. The roles SECURITYADMIN and ACCOUNTADMIN cannot be included in this list.
Tip Tip: The roles in this list should match up with the roles that are scoped in the OAuth 2.0 client in the
. In the client, you can specify the Snowflake roles that are permitted to use the client for authentication. Roles that are scoped for access that are not in this list must consent to access Snowflake after login. In some use cases, such as API access or scheduled executions, this can be problematic.D s webapp type Portal BLOCKED_ROLES_LIST A comma-separated list of Snowflake roles that cannot explicitly consent to use when accessing Snowflake. The roles SECURITYADMIN and ACCOUNTADMIN are included by default in this list. If you need to remove either of those roles, please contact Snowflake Support. <NETWORK_POLICY> (Optional) Provide the identifier for any applicable Snowflake network policy. <COMMENT> (Optional) Add a comment if needed. Run the above command. The security integration is created.
Paste the following command and run it to acquire the following information: Client ID, Authorization URL, Token URL, and Refresh Token Expires In, where
<NAME>
Is the name you provided above:Code Block DESC integration <NAME>
Retain the values for the following parameters. You must apply these parameters to the OAuth 2.0 client that you create in the the
:D s webapp type Portal Snowflake parameter
Client parameterD s webapp type Portal OAUTH_CLIENT_ID Client Id OAUTH_AUTHORIZATION_ENDPOINT Authorization URL OAUTH_TOKEN_ENDPOINT Token URL OAUTH_REFRESH_TOKEN_VALIDITY Refresh Token Expires In Paste the following command and run it to acquire the client secret, where
<NAME>
Is the name you provided above:Code Block SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('<NAME>')
Retain the values for the following. You must apply these parameters to the OAuth 2.0 client that you create in the the
:D s webapp type Portal Snowflake parameter
Client parameterD s webapp type Portal OAUTH_CLIENT_SECRET Client Secret - Save your changes.
Create OAuth 2.0 Client for Snowflake
After the Snowflake client app is created, you must create an OAuth 2.0 client in the the
D s webapp | ||
---|---|---|
|
Info | |||||
---|---|---|---|---|---|
NOTE: You must create one OAuth 2.0 client in the
|
Steps:
- Login to the the
as a workspace administrator.D s webapp type Portal - In the lefthand menu, select User menu > Admin console > OAuth 2.0 Clients.
- In the OAuth 2.0 Clients page, click Register OAuth 2.0.0 Client.
- Specify the new client.
- For the Type value, select
snowflake
. - You must apply the values listed in the previous section to your client object.
- For more information on Scopes, see "Scopes for Snowflake" below.
Access Token Expires in:
600000
Info NOTE: The value of
600000
is required for Snowflake.
- For the Type value, select
- To save your OAuth 2.0 client, click Save.
...
Code Block |
---|
refresh_token session:role:<role_name> |
Scope | Description | ||||
---|---|---|---|---|---|
refresh_token | (required) Snowflake session tokens have a short duration. By adding this scope, a refresh token is issued for the session. This token allows the OAuth 2.0 client to refresh the connection with Snowflake without user interaction. | ||||
role:<role_name> | (optional) The Snowflake role for which you wish to access its databases, schemas, and tables. If this value is not provided, then the default role is used.
|
Create Snowflake Connection
...
Info | ||||
---|---|---|---|---|
NOTE: You must create a separate connection for each OAuth 2.0 client that is available in the
|
For more information, see Snowflake Connections.
...
If you receive an invalid consent request error, then the user that is passed for OAuth 2.0 authorization does authorization does not have access to the role that is referenced in the corresponding OAuth 2.0 client that you created in the the
D s webapp | ||
---|---|---|
|
You can do one of the following:
- Specify a different user in the connection.
Create a new OAuth 2.0 client in the the
which is scoped for a role that the database user has.D s webapp type Portal Info NOTE: This new role must also be authorized to use the security integration within Snowflake.
...