Skip to content

fix(opencode): pass OAuth scopes to GoogleAuth for Vertex AI#15110

Open
sauravhiremath wants to merge 1 commit intoanomalyco:devfrom
sauravhiremath:fix/google-vertex-service-account-auth-scopes
Open

fix(opencode): pass OAuth scopes to GoogleAuth for Vertex AI#15110
sauravhiremath wants to merge 1 commit intoanomalyco:devfrom
sauravhiremath:fix/google-vertex-service-account-auth-scopes

Conversation

@sauravhiremath
Copy link

Issue for this PR

Closes #15109

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

GoogleAuth() without scopes fails for service account credentials with "invalid_scope" error.

User credentials (gcloud ADC) work without scopes because they embed scopes in the refresh token, but service accounts require explicit scopes to complete the OAuth flow.

Fixes auth when GOOGLE_APPLICATION_CREDENTIALS points to a service_account JSON.

How did you verify your code works?

Ran a local version of the opencode build, no longer see the error

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

GoogleAuth() without scopes fails for service account credentials with
"invalid_scope" error. User credentials (gcloud ADC) work without scopes
because they embed scopes in the refresh token, but service accounts require
explicit scopes to complete the OAuth flow.

Fixes auth when GOOGLE_APPLICATION_CREDENTIALS points to a service_account JSON.
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.

Bug: OAuth scopes missing for GoogleAuth for Vertex AI service account auth

1 participant