OAuth Authentication¶
The default authentication mechanism in the Databricks SQL connector is token-based, but it also provides the option to enable OAuth. To generate OAuth credentials for the Databricks SQL, follow the instructions in the Databricks documentation.
Prerequisites¶
Given below is the instructions to generate OAuth credentials for the Databricks SQL. The instructions might change, so it is recommended to refer to the latest Databricks documentation.
It is important to note that the service principal should have the necessary permissions to manage the policies in the Databricks SQL.
- Generate OAuth token: Refer to the Databricks documentation on how to use a service principal to authenticate with Databricks.
- Note down the Secret and Client ID during the OAuth Secret generation.
-
To ensure the generated service principal has the necessary permissions, follow these steps:
- Add the service principal to the Admin Group in Databricks.
- Login into Databricks SQL Workspace URL
- Go to settings "Identity and access" → Management and permissions → Groups → Click on Manage.
- Locate the Admin Group and add your service principal.
- Grant the service principal admin privileges to manage resources.
- Ensure the service principal has access to all required databases and tables.
-
Ensure that the service principal you create is added to the Admin Group Role in Databricks and has admin access.
- It must have access to all required databases and tables.
Setup¶
Replace <server-hostname>, <http-path>, <CLIENT_ID> and <CLIENT_SECRET> with the actual values.
-
Navigate to Settings → Applications in the Self-Managed Portal.
-
From the list of Connected Applications, select Databricks SQL.
-
Click on the application name or the icon to edit. Then, go to the Access Management tab.
-
Under the BASIC tab
-
Update the value for JDBC Authentication Mechanism as
oauth. -
Update the value for Databricks JDBC url with the following format:
-
Make sure the value for Databricks personal access token is empty.
-
Add the values for OAuth Client ID and OAuth Client Secret.
-
-
Click SAVE to apply the changes.
To enable OAuth authentication, update the following properties in Privacera Manager:
-
SSH to the instance where Privacera Manager is installed.
-
Run the following command to open the
.ymlfile to be edited.If you have multiple connectors, then replace
instance1with the appropriate connector instance name.Bash -
Set the following properties to enable OAuth authentication for the Databricks SQL Connector:
-
Once the properties are configured, run the following commands to update your Privacera Manager platform instance:
Step 1 - Setup which generates the helm charts. This step usually takes few minutes.
Step 2 - Apply the Privacera Manager helm charts. Step 3 - (Optional) Post-installation step which generates Plugin tar ball, updates Route 53 DNS and so on. This step is not required if you are updating only connector properties.
-
In PrivaceraCloud portal, navigate to Settings -> Applications.
-
On the Connected Applications screen, select Databricks SQL.
-
Click the pen icon or the Account Name to modify the settings.
-
On the Edit Application screen, go to Access Management.
-
Under the BASIC tab
-
Update the value for JDBC Authentication Mechanism as
oauth. -
Update the value for Databricks JDBC url with the following format:
-
Make sure the value for Databricks personal access token is empty.
-
Add the values for OAuth Client ID and OAuth Client Secret.
-
-
Click SAVE to apply the changes.
- Prev topic: Advanced Configuration