Skip to content

Commit c9dbe91

Browse files
jacalataclaude
andauthored
docs: add Snowflake keypair auth conversion how-to (#1845)
Adds a short how-to under datasources.update_connection describing how to flip an existing connection from username/password to Snowflake keypair authentication (REST API v3.27+), including the prerequisite of saving the private key under Site Settings -> Saved Credentials for Data Sources. Links to the new samples/update_connection_to_keypair.py runnable sample. Refs #1602 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4e21781 commit c9dbe91

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

docs/api-ref.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,21 @@ conn.username = 'newuser'
17091709
updated_conn = server.datasources.update_connection(datasource_item, conn)
17101710
```
17111711

1712+
**How-to: convert an existing connection to Snowflake keypair auth**
1713+
1714+
As of REST API v3.27, an existing connection can be flipped from username/password to Snowflake keypair authentication in place. First save the private key on the site under **Site Settings -> Saved Credentials for Data Sources** (keyed on server address + username); the update call only records the auth type and username, it does not carry the key. Then:
1715+
1716+
```py
1717+
server.datasources.populate_connections(datasource_item)
1718+
conn = next(c for c in datasource_item.connections if c.connection_type == 'snowflake')
1719+
conn.auth_type = 'auth-keypair'
1720+
conn.username = 'my_snowflake_user'
1721+
conn.embed_password = True
1722+
server.datasources.update_connection(datasource_item, conn)
1723+
```
1724+
1725+
See [`samples/update_connection_to_keypair.py`](https://github.com/tableau/server-client-python/blob/master/samples/update_connection_to_keypair.py) for a runnable end-to-end example, and the REST API [authenticationType reference](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#update_data_source_connection) for the full list of supported values.
1726+
17121727
<br>
17131728
<br>
17141729

0 commit comments

Comments
 (0)