You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 542d0e8
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/api-ref.md
+91-5Lines changed: 91 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -233,6 +233,8 @@ Name | Description
233
233
`server_address` | The server address for the connection (host name for the Tableau Server).
234
234
`server_port` | The port used for the connection.
235
235
`connection_credentials` | The Connection Credentials object containing authentication details for the connection. Replaces username/password/embed_password when publishing a flow, document or workbook file in the request body.
236
+
`workgroup_auth_mode` | (Optional) The Workload Identity Federation (WIF) auth mode for the connection. Set to one of the values on the `ConnectionItem.WorkgroupAuthMode` nested value set: `WIF` (`"workload-identity-federation"`, e.g. Snowflake direct WIF) or `WIF_IMPERSONATION` (`"workload-identity-federation-impersonation"`, e.g. Google BigQuery impersonation WIF). Requires REST API 3.30+ (Tableau Server release 26.3) with WIF configured on the site. Older servers silently ignore the attribute.
237
+
`auth_federation_service_account` | (Optional) The service account email the server impersonates for WIF. Set this only together with `workgroup_auth_mode = WorkgroupAuthMode.WIF_IMPERSONATION`; the server rejects a service account alongside the direct `WIF` mode.
See [`samples/update_connection_auth.py`](https://github.com/tableau/server-client-python/blob/master/samples/update_connection_auth.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
1728
1729
+
**How-to: convert an existing connection to Workload Identity Federation (WIF)**
1730
+
1731
+
As of REST API v3.30 (Tableau Server release 26.3), an existing connection on a WIF-configured site can be flipped to WIF authentication in place. Set `workgroup_auth_mode` on the `ConnectionItem` to one of the values on the `ConnectionItem.WorkgroupAuthMode` nested value set; for the impersonation mode, also set `auth_federation_service_account` to the service account email. The server derives the stored auth type from the mode, so leave `auth_type` unset or `"oauth"`.
- Resend `workgroup_auth_mode` on every subsequent update of a WIF connection; omitting it on a later update returns HTTP 400.
1755
+
- Set `auth_federation_service_account` only with `WorkgroupAuthMode.WIF_IMPERSONATION`. The server rejects a service account alongside the direct `WIF` mode.
1756
+
- The server does not echo `workgroupAuthMode` or `authFederationServiceAccount` on connections-GET responses today, so `ConnectionItem.workgroup_auth_mode` and `ConnectionItem.auth_federation_service_account` parsed from a response will typically be `None` even when the connection is WIF-configured.
Bulk updates one or more datasource connections by LUID.
@@ -1739,18 +1770,20 @@ REST API: [Update Data Source Connections](https://help.tableau.com/current/api/
1739
1770
1740
1771
**Version**
1741
1772
1742
-
This endpoint is available with REST API version 3.26 and up.
1773
+
This endpoint is available with REST API version 3.26 and up. The `workgroup_auth_mode` and `auth_federation_service_account` parameters require REST API 3.30+ (Tableau Server release 26.3).
1743
1774
1744
1775
**Parameters**
1745
1776
1746
1777
Name | Description
1747
1778
:--- | :---
1748
1779
`datasource_item` | The `DatasourceItem` containing the connections to update.
1749
1780
`connection_luids` | An iterable of connection LUIDs (strings) to update.
1750
-
`authentication_type` | The authentication type to use (e.g., `'auth-keypair'`).
1781
+
`authentication_type` | The authentication type to use (e.g., `'auth-keypair'`). Leave unset or `"oauth"` when sending `workgroup_auth_mode`; the server derives the stored auth type from the WIF mode.
1751
1782
`username` | (Optional) The username to set.
1752
1783
`password` | (Optional) The password or secret to set.
1753
1784
`embed_password` | (Optional) Whether to embed the password.
1785
+
`workgroup_auth_mode` | (Optional) WIF auth mode to apply to every LUID in the request. One of `ConnectionItem.WorkgroupAuthMode.WIF` or `ConnectionItem.WorkgroupAuthMode.WIF_IMPERSONATION`. Requires REST API 3.30+.
1786
+
`auth_federation_service_account` | (Optional) Service account email to apply to every LUID. Set only together with `WIF_IMPERSONATION`.
1754
1787
1755
1788
**Returns**
1756
1789
@@ -1764,6 +1797,19 @@ luids = [conn.id for conn in datasource_item.connections]
**Workload Identity Federation (WIF):** setting `connection_item.workgroup_auth_mode` (and, for impersonation, `connection_item.auth_federation_service_account`) emits the matching attributes on the request payload via the shared `Connection.update_req` builder. Server-side handling of WIF on flow connections is governed by the flow endpoint and may differ from workbook and datasource behavior.
**How-to: convert an existing workbook connection to Workload Identity Federation (WIF)**
10427
+
10428
+
As of REST API v3.30 (Tableau Server release 26.3), an existing connection on a WIF-configured site can be flipped to WIF authentication in place. Set `workgroup_auth_mode` on the `ConnectionItem` to one of the values on the `ConnectionItem.WorkgroupAuthMode` nested value set; for the impersonation mode, also set `auth_federation_service_account`. The server derives the stored auth type from the mode, so leave `auth_type` unset or `"oauth"`.
10429
+
10430
+
```py
10431
+
# Direct WIF (e.g., Snowflake)
10432
+
server.workbooks.populate_connections(workbook)
10433
+
conn =next(c for c in workbook.connections if c.connection_type =='snowflake')
Resend `workgroup_auth_mode` on every subsequent update of a WIF connection; omitting it on a later update returns HTTP 400. Set `auth_federation_service_account` only with `WIF_IMPERSONATION` — the server rejects a service account alongside the direct `WIF` mode. The server does not echo these attributes on connections-GET responses today, so parsed values are typically `None`.
10445
+
10378
10446
<br>
10379
10447
<br>
10380
10448
@@ -10774,23 +10842,29 @@ result = server.workbooks.schedule_extract_refresh('schedule-id-here', workbook)
The `workgroup_auth_mode` and `auth_federation_service_account` parameters require REST API 3.30+ (Tableau Server release 26.3).
10855
+
10784
10856
**Parameters**
10785
10857
10786
10858
Name | Description
10787
10859
:--- | :---
10788
10860
`workbook_item` | The `WorkbookItem` containing the connections to update.
10789
10861
`connection_luids` | An iterable of connection LUIDs (strings) to update.
10790
-
`authentication_type` | The authentication type to use (e.g., `'AD Service Principal'`).
10862
+
`authentication_type` | The authentication type to use (e.g., `'AD Service Principal'`). Leave unset or `"oauth"` when sending `workgroup_auth_mode`; the server derives the stored auth type from the WIF mode.
10791
10863
`username` | (Optional) The username to set (e.g., client ID for keypair auth).
10792
10864
`password` | (Optional) The password or secret to set.
10793
10865
`embed_password` | (Optional) Whether to embed the password.
10866
+
`workgroup_auth_mode` | (Optional) WIF auth mode to apply to every LUID in the request. One of `ConnectionItem.WorkgroupAuthMode.WIF` or `ConnectionItem.WorkgroupAuthMode.WIF_IMPERSONATION`. Requires REST API 3.30+.
10867
+
`auth_federation_service_account` | (Optional) Service account email to apply to every LUID. Set only together with `WIF_IMPERSONATION`.
10794
10868
10795
10869
**Returns**
10796
10870
@@ -10805,6 +10879,18 @@ luids = [conn.id for conn in workbook.connections]
0 commit comments