Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Vertexai auth #2

Copy link
Copy link
@LuisLechugaRuiz

Description

@LuisLechugaRuiz
Issue body actions

Hello,

I'm encountering an issue using the Google GenAI client with Vertex AI credentials. Here's the relevant snippet of my code:

from google.oauth2 import service_account
from google.genai import Client

credentials = service_account.Credentials.from_service_account_file('path/to/credentials.json')
client = Client(vertexai=True, project='my-project-id', location='us-central1', credentials=credentials)

When running this code, it crashes with the following error:

('invalid_scope: Invalid OAuth scope or ID token audience provided.', {'error': 'invalid_scope', 'error_description': 'Invalid OAuth scope or ID token audience provided.'})

What I’ve Tried:

  • The same service account credentials work for other Vertex AI operations.
  • Verified the service account has sufficient permissions.

Question:

  • Do I need to adjust the OAuth scope or provide additional parameters for the GenAI client?
  • Are there any known incompatibilities or additional setup steps for using Vertex credentials with the GenAI client?

Thank you!

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.