Skip to content

Commit

Permalink
Update BigQuery OAuth docs with Redirect URI UI (#5698)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?

The multicell engineering team has changed how dbt Cloud users should
source the Redirect URI for configuring BigQuery OAuth. The redirect URI
is now sourced from the connection details page instead of using
regional access URLs. This change is being made to support assigning
static subdomains to US multi-tenant accounts.

This change coincides with us running the task to backfill BigQuery
OAuth redirect URIs, as documented in MUL-944. This change should not be
merged into the "current" branch until we perform the backfill task.

### When does this matter?

The currently live documentation is still applicable, but will no longer
be correct once we start assigning static subdomains to US multi-tenant
accounts. We have not started to do this; we will probably start to do
this within the next few months. This change is applicable now _and_
once we start assigning static subdomains.

## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- ~For [docs
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#about-versioning),
review how to [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content).~
- [x] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."
  - [x] Complete backfill task in MUL-944

---------

Co-authored-by: Ly Nguyen <[email protected]>
  • Loading branch information
eiof and nghi-ly authored Jun 27, 2024
1 parent aa7fe75 commit 7278fcd
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions website/docs/docs/cloud/manage-access/set-up-bigquery-oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,22 @@ dbt Cloud supports developer [OAuth](https://cloud.google.com/bigquery/docs/auth


To set up BigQuery OAuth in dbt Cloud, a BigQuery admin must:
1. [Create a BigQuery OAuth 2.0 client ID and secret](#creating-a-bigquery-oauth-20-client-id-and-secret) in BigQuery.
2. [Configure the connection](#configure-the-connection-in-dbt-cloud) in dbt Cloud.
1. [Locate the redirect URI value](#locate-the-redirect-uri-value) in dbt Cloud.
2. [Create a BigQuery OAuth 2.0 client ID and secret](#creating-a-bigquery-oauth-20-client-id-and-secret) in BigQuery.
3. [Configure the connection](#configure-the-connection-in-dbt-cloud) in dbt Cloud.

To use BigQuery in the dbt Cloud IDE, all developers must:
1. [Authenticate to BigQuery](#authenticating-to-bigquery) in the their profile credentials.

### Locate the redirect URI value
To get started, locate the connection's redirect URI for configuring BigQuery OAuth. To do so:
- Select the gear menu in the upper left corner and choose **Account settings**
- From the left sidebar, select **Projects**
- Choose the project from the list
- Select **Connection** to edit the connection details
- Locate the **Redirect URI** field under the **OAuth 2.0 Settings** section. Copy this value to your clipboard to use later on.

<Lightbox src="/img/docs/dbt-cloud/using-dbt-cloud/dbt-cloud-enterprise/BQ-auth/dbt-cloud-bq-id-secret-02.gif" title="Accessing the BigQuery OAuth configuration in dbt Cloud" />

### Creating a BigQuery OAuth 2.0 client ID and secret
To get started, you need to create a client ID and secret for [authentication](https://cloud.google.com/bigquery/docs/authentication) with BigQuery. This client ID and secret will be stored in dbt Cloud to manage the OAuth connection between dbt Cloud users and BigQuery.
Expand All @@ -34,40 +44,30 @@ On the **Credentials** page, you can see your existing keys, client IDs, and ser

Set up an [OAuth consent screen](https://support.google.com/cloud/answer/6158849) if you haven't already. Then, click **+ Create Credentials** at the top of the page and select **OAuth client ID**.

Fill in the application, replacing `YOUR_ACCESS_URL` with the [appropriate Access URL](/docs/cloud/about-cloud/access-regions-ip-addresses) for your region and plan:

| Config | Value |
| ------ | ----- |
| **Application type** | Web application |
| **Name** | dbt Cloud |
| **Authorized Javascript origins** | https://YOUR_ACCESS_URL |
| **Authorized Redirect URIs** | https://YOUR_ACCESS_URL/complete/bigquery |
Fill in the client ID configuration. **Authorized JavaScript Origins** are not applicable. Add an item to **Authorized redirect URIs** and replace `REDIRECT_URI` with the value you copied to your clipboard earlier from the connection's **OAuth 2.0 Settings** section in dbt Cloud:

| Config | Value |
| ---------------------------- | --------------- |
| **Application type** | Web application |
| **Name** | dbt Cloud |
| **Authorized redirect URIs** | `REDIRECT_URI` |

Then click **Create** to create the BigQuery OAuth app and see the app client ID and secret values. These values are available even if you close the app screen, so this isn't the only chance you have to save them.

<Lightbox src="/img/docs/dbt-cloud/using-dbt-cloud/dbt-cloud-enterprise/BQ-auth/bq-oauth-app.gif" title="Creating an OAuth app in BigQuery" />


<Lightbox src="/img/docs/dbt-cloud/using-dbt-cloud/dbt-cloud-enterprise/BQ-auth/bq-oauth-app-02.png" title="Create an OAuth app in BigQuery" />

### Configure the Connection in dbt Cloud
Now that you have an OAuth app set up in BigQuery, you'll need to add the client ID and secret to dbt Cloud. To do so:
- go to Settings by clicking the gear in the top right.
- on the left, select **Projects** under **Account Settings**
- choose your project from the list
- select **Connection** to edit the connection details
- add the client ID and secret from the BigQuery OAuth app under the **OAuth2.0 Settings** section


<Lightbox src="/img/docs/dbt-cloud/using-dbt-cloud/dbt-cloud-enterprise/BQ-auth/dbt-cloud-bq-id-secret.gif" title="Adding BigQuery OAuth application client ID and secret to dbt Cloud" />
- Navigate back to the connection details page, as described in [Locate the redirect URI value](#locate-the-redirect-uri-value)
- Add the client ID and secret from the BigQuery OAuth app under the **OAuth 2.0 Settings** section

### Authenticating to BigQuery
Once the BigQuery OAuth app is set up for a dbt Cloud project, each dbt Cloud user will need to authenticate with BigQuery in order to use the IDE. To do so:

- Click the gear icon at the top right and select **Profile settings**.
- Select **Credentials**.
- choose your project from the list
- select **Authenticate BigQuery Account**
- Select the gear menu in the upper left corner and choose **Profile settings**
- From the left sidebar, select **Credentials**
- Choose the project from the list
- Select **Authenticate BigQuery Account**
<Lightbox src="/img/docs/dbt-cloud/using-dbt-cloud/dbt-cloud-enterprise/developer-bq-auth.gif" title="Authenticating to BigQuery" />

You will then be redirected to BigQuery and asked to approve the drive, cloud platform, and BigQuery scopes, unless the connection is less privileged.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit 7278fcd

Please sign in to comment.