Skip to content

Why does Workload Identity Federation for using Vertex Backend only applicable when HTTPClient is not used #660

@somakdutta

Description

@somakdutta

Hello,

I am attempting to connect to Vertex AI Backend using the go-genai library for using gemini models.

Additionally i would like to use WIF for authentication. My question is :
based on the code here why is WIF / or automatic credential look up only respected when httpclient is not set up in the clientConfig?

What if we would like to use the WIF and a wrapped httpclient , lets say with specific error codes being set as retry options?

The error message received when httpclient option was provided was

Error 401, Message: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project., Status: UNAUTHENTICATED, Details: [map[@type:type.googleapis.com/google.rpc.ErrorInfo domain:googleapis.com metadata:map[method:google.cloud.aiplatform.v1beta1.PredictionService.GenerateContent service:aiplatform.googleapis.com] reason:CREDENTIALS_MISSING]] 

Regards

Metadata

Metadata

Labels

api:gemini-apiIssues related to Gemini APIpriority: p3Desirable enhancement or fix. May not be included in next release.type: questionRequest 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