From 78a97b826cfa7c80a8b44f9b10d75446ff3d58a7 Mon Sep 17 00:00:00 2001 From: Shri Tikone Date: Thu, 15 May 2025 15:12:07 -0700 Subject: [PATCH 1/2] Update API ref docs for adding idp_configuration_id and list authentication configurations --- docs/api-ref.md | 71 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/docs/api-ref.md b/docs/api-ref.md index 8cd002a91..c9683bc94 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -1420,7 +1420,6 @@ The job properties are defined in the `JobItem` class. The class corresponds to JobItem(id, type, created_at, started_at=None, completed_at=None, finish_code=0) ``` - The `JobItem` class contains information about the specified job running on Tableau Server. The `JobItem` class defines the information you can query from Tableau Server. The class members correspond to the attributes of a server response payload. Source file: models/job_item.py @@ -3437,6 +3436,42 @@ Source file: models/site_item.py
+### SiteAuthConfiguration class + +The `SiteAuthConfiguration` class contains the attributes for the authentication configuration on Tableau Cloud. This class represents the authentication configuration information returned when using the `sites.list_authentication_configurations` method. + +**Attributes** + +Attribute | Description +:--- | :--- +`auth_setting` | The authentication type (e.g., SAML, OpenID, TableauIDWithMFA). +`enabled` | Boolean value indicating whether the authentication configuration is enabled. +`idp_configuration_id` | The unique identifier for the authentication configuration. +`idp_configuration_name` | The name of the authentication configuration. +`known_provider_alias` | The provider name for the authentication method in case of OpenID configuration. + +**Example** + +```py +# import tableauserverclient as TSC +# server = TSC.Server('https://MY-SERVER') +# sign in, etc. + +# Get authentication configurations for the current site +auth_configs = server.sites.list_authentication_configurations() + +# Display configuration details +for config in auth_configs: + print(f"ID: {config.idp_configuration_id}") + print(f"Name: {config.idp_configuration_name}") + print(f"Type: {config.auth_setting}") + print(f"Enabled: {config.enabled}") + print(f"Provider: {config.known_provider_alias}") +``` + +
+
+ ### Site methods The TSC library provides methods that operate on sites for Tableau Server and Tableau Cloud. These methods correspond to endpoints or methods for sites in the Tableau REST API. @@ -3730,6 +3765,38 @@ server.sites.delete('9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d')

+#### sites.list_authentication_configurations + +```py +sites.list_authentication_configurations() +``` + +Lists the authentication configurations for the current site. + +REST API: [List Authentication Configurations for the current Site](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_site.htm#list_authentication_configurations_site) + +**Returns** + +Returns a list of authentication configurations for the current site. + +**Example** + +```py +# import tableauserverclient as TSC +# server = TSC.Server('https://MY-SERVER') +# sign in, etc. + +auth_configs = server.sites.list_authentication_configurations() +for config in auth_configs: + print(f"IDP Configuration ID: {config.idp_configuration_id}") + print(f"Name: {config.idp_configuration_name}") + print(f"Type: {config.auth_setting}") + print(f"Enabled: {config.enabled}") +``` + +
+
+ --- @@ -4297,6 +4364,8 @@ Name | Description `name` | The name of the user. This attribute is required when you are creating a `UserItem` instance. `site_role` | The role the user has on the site. This attribute is required if you are creating a `UserItem` instance. See *User Roles* below for details. `groups` | The groups that the user belongs to. You must run the populate_groups method to add the groups to the `UserItem`. +`idp_configuration_id` | Tableau Cloud only. The authentication method for the user. To find the idp_configuration_id value, use sites.list_authentication_configurations method. **Important: Use idp_configuration_id or auth_setting, but not both.** + **User Auth** From 8efeae3693a1400b5fd791898277bcfd96b5511c Mon Sep 17 00:00:00 2001 From: Shri Tikone Date: Thu, 15 May 2025 15:17:03 -0700 Subject: [PATCH 2/2] Add newline back --- docs/api-ref.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/api-ref.md b/docs/api-ref.md index c9683bc94..59ed1b345 100644 --- a/docs/api-ref.md +++ b/docs/api-ref.md @@ -1420,6 +1420,7 @@ The job properties are defined in the `JobItem` class. The class corresponds to JobItem(id, type, created_at, started_at=None, completed_at=None, finish_code=0) ``` + The `JobItem` class contains information about the specified job running on Tableau Server. The `JobItem` class defines the information you can query from Tableau Server. The class members correspond to the attributes of a server response payload. Source file: models/job_item.py