Skip to content

[feat] OAuth support (#307)#327

Merged
susodapop merged 2 commits into
mainfrom
staging-307
May 1, 2023
Merged

[feat] OAuth support (#307)#327
susodapop merged 2 commits into
mainfrom
staging-307

Conversation

@andrefurlan-db
Copy link
Copy Markdown
Collaborator

@andrefurlan-db andrefurlan-db commented Apr 28, 2023

Description

This PR adds support for OAuth: both 3-legged and 2-legged.

From a user perspective, token is not mandatory anymore. OAuth with SSO (browser login) will be used if auth_type: oauth is defined.

For automation and CI/CD use cases, client_id and client_secret are now available as config.

Usage

AWS

It just works as long as admin has enabled databricks-dbt-adapter as an OAuth application:

curl -n -X POST https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/published-app-integrations -d '{ "app_id" : "databricks-dbt-adapter" }'

Profile:

  type: databricks
  host: "<your databricks host name>"
  http_path: "<http path for warehouse >"
  auth_type: "oauth"

Azure

A Public client/ Native Azure AD Application must be created with redirect URL http://localhost:8020. For SSO, Azure Application (client) ID must be used for client_id.
Profile:

  type: databricks
  host: "<your databricks host name>"
  http_path: "<http path for warehouse >"
  client_id: "<Azure AD Application ID>"
  auth_type: "oauth"

GCP

GCP is not supported at the moment.

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.

* oauth support

---------

Signed-off-by: Andre Furlan <andre.furlan@databricks.com>
@andrefurlan-db andrefurlan-db changed the title OAuth support (#307) [feat] OAuth support (#307) Apr 28, 2023
susodapop
susodapop previously approved these changes May 1, 2023
Copy link
Copy Markdown

@susodapop susodapop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a small nit

Comment thread .gitignore Outdated
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
@susodapop susodapop dismissed stale reviews from rcypher-databricks and themself via d435c1c May 1, 2023 18:59
@susodapop susodapop temporarily deployed to azure-prod-pecou May 1, 2023 18:59 — with GitHub Actions Inactive
@susodapop susodapop temporarily deployed to azure-prod-peco May 1, 2023 18:59 — with GitHub Actions Inactive
@susodapop susodapop merged commit d62a514 into main May 1, 2023
@susodapop susodapop deleted the staging-307 branch May 1, 2023 20:10
andrefurlan-db added a commit that referenced this pull request May 2, 2023
Signed-off-by: Andre Furlan <andre.furlan@databricks.com>
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
Co-authored-by: Jesse <jesse.whitehouse@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants