Skip to content

(v1.27.0) BigQueryCredentialsConfig default BIGQUERY_SCOPES includes invalid OAuth scope https://www.googleapis.com/auth/dataplex #4805

@mlaslie

Description

@mlaslie

bigquery_credentials.py defines the following default scopes:

BIGQUERY_SCOPES = [
'https://www.googleapis.com/auth/bigquery',
'https://www.googleapis.com/auth/dataplex',
]

The valid Dataplex OAuth scopes are:

This leads to an oauth error:

Some requested scopes were invalid. {valid=[https://www.googleapis.com/auth/bigquery], invalid=[https://www.googleapis.com/auth/dataplex]}

To reproduce:

  1. pip install google-adk==1.27.0
  2. Initialise BigQueryCredentialsConfig(client_id=..., client_secret=...) without overriding scopes
  3. Trigger the OAuth consent flow via any BigQuery tool
  4. Observe invalid_scope error from Google's authorization server

Functional workaround (agent.py):

BIGQUERY_SCOPES = [
    'https://www.googleapis.com/auth/bigquery',
    'https://www.googleapis.com/auth/dataplex.read-write', 
    ] 

_bq_credentials_config = BigQueryCredentialsConfig(
    client_id=OAUTH_CLIENT_ID,
    client_secret=OAUTH_CLIENT_SECRET,
    scopes=BIGQUERY_SCOPES,
)

bigquery_toolset = BigQueryToolset(
    credentials_config=_bq_credentials_config, bigquery_tool_config=_bq_tool_config
    )
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bq[Component] This issue is related to Big Query integration

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions