bito-code-review[bot] commented on code in PR #41421:
URL: https://github.com/apache/superset/pull/41421#discussion_r3476308923


##########
docs/user_docs_versioned_docs/version-6.0.0/configuration/databases.mdx:
##########
@@ -519,6 +519,82 @@ For a connection to a SQL endpoint you need to use the 
HTTP path from the endpoi
 {"connect_args": {"http_path": "/sql/1.0/endpoints/****", "driver_path": 
"/path/to/odbc/driver"}}
 ```
 
+##### OAuth2 Authentication
+
+Superset supports OAuth2 authentication for Databricks, allowing users to 
authenticate with their personal Databricks accounts instead of using shared 
access tokens. This provides better security and audit capabilities.
+
+###### Prerequisites
+
+1. Create an OAuth2 application in your Databricks account:
+   - Go to your Databricks account console
+   - Navigate to **Settings** → **Developer** → **OAuth apps**
+   - Create a new OAuth app with the redirect URI: 
`http://your-superset-host:port/api/v1/database/oauth2/`
+
+2. Configure OAuth2 in your `superset_config.py`:
+
+```python
+from datetime import timedelta
+
+# OAuth2 configuration for Databricks
+# OAuth2 endpoints are automatically detected based on your Databricks cloud 
provider
+DATABASE_OAUTH2_CLIENTS = {
+    "Databricks (legacy)": {
+        "id": "your-databricks-client-id",
+        "secret": "your-databricks-client-secret",
+        "scope": "sql",
+        # OAuth2 endpoints are auto-detected based on hostname, but can be 
overridden:
+        # AWS: "authorization_request_uri": 
"https://accounts.cloud.databricks.com/oidc/accounts/{account_id}/v1/authorize";,
+        # Azure: "authorization_request_uri": 
"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/authorize";,
+        # GCP: "authorization_request_uri": 
"https://accounts.gcp.databricks.com/oidc/accounts/{account_id}/v1/authorize";,

Review Comment:
   <!-- Bito Reply -->
   The reviewer is correct. The `account_id` placeholder in the URL templates 
is not being substituted because the configuration loading logic does not 
extract or pass an `account_id` field. To resolve this, you should update the 
configuration loading logic to include `account_id` and perform the string 
substitution on the authorization URI before it is used.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to