Manage OAuth (Public Preview) for Power BI and Tableau

Preview

This feature is in Public Preview.

This article describes how to manage the OAuth application integrations that you configured in Configure OAuth (Public Preview) for Power BI Configure OAuth (Public Preview) for Tableau.

Before you begin

Before you modify OAuth application integrations, do the following:

  • Install cURL or an alternative tool for issuing HTTP requests (Mac OS, Windows).

  • Locate your account ID.

  • Locate the ID of the OAuth application integration you want to modify.

    • For Power BI and Tableau Desktop, run the following curl command:

      curl -n -X GET https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/ published-app-integrations
      
    • For Tableau Cloud and Tableau Server, run the following curl command:

      curl -n -X GET https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/custom-app-integrations
      

Configure a .netrc file to securely pass credentials using cURL

This section describes how to configure a .netrc file to securely pass your Databricks username and password using cURL.

Mac OS

Run the following command, replacing <Databricks account username> and <Databricks account password> with your credentials:

echo machine accounts.cloud.databricks.com login <Databricks account username> password <Databricks account password> >> ~/.netrc

Windows

  1. Run the following command:

    setx HOME %USERPROFILE%
    
  2. In a new terminal window, run the following command, replacing <Databricks account username> and <Databricks account password> with your credentials:

    cd %HOME%
    echo machine accounts.cloud.databricks.com login <Databricks account username> password <Databricks account password> >> .netrc
    

Disable OAuth for Power BI or Tableau Desktop

To disable OAuth for Power BI or Tableau Desktop, run the following curl command:

curl -n -X DELETE https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/published-app-integrations/<Integration ID>

Override the default token lifetime policy for Power BI or Tableau Desktop

To override the default token lifecycle policy for Power BI or Tableau Desktop, run the following curl command:

curl -n -X PATCH -d '{ "token_access_policy": {"access_token_ttl_in_minutes":10,"refresh_token_ttl_in_minutes":200} }' https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/published-app-integrations/<Integration ID>

Important

(Windows) You must use double quotes around the data argument and escape all quotes inside this. For example:

curl -n -X PATCH -d "{ \"token_access_policy\": {\"access_token_ttl_in_minutes\":10,\"refresh_token_ttl_in_minutes\":200} }" https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/published-app-integrations/<Integration ID>

Disable OAuth for Tableau Cloud or Tableau Server

To disable OAuth for Tableau Cloud or Tableau Server, run the following curl command:

curl -n -X DELETE https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/custom-app-integrations/<Integration ID>

Override the default token lifetime policy for Tableau Cloud or Tableau Server

To override the default token lifecycle policy for Tableau Cloud or Tableau Server, run the following curl command:

curl -n -X PATCH -d '{ "token_access_policy": {"access_token_ttl_in_minutes":10,"refresh_token_ttl_in_minutes":200} }' https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/custom-app-integrations/<Integration ID>

Important

(Windows) You must use double quotes around the data argument and escape all quotes inside this. For example:

curl -n -X PATCH -d "{ \"token_access_policy\": {\"access_token_ttl_in_minutes\":10,\"refresh_token_ttl_in_minutes\":200} }" https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/custom-app-integrations/<Integration ID>