I am trying to use VertexAIGeminiChat module in my spring boot app, but when I use a service account json file in credentialsUri, I get this error:

UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project

Comment From: ddobrin

Could you please add to the application.properties (or adjust for YAML): "spring.ai.vertex.ai.gemini.transport=rest"

For the ServiceAccount, just to check, are the following IAM roles specified: - Vertex AI User (roles/vertexai.user): Allows the service account to use Vertex AI features - Service Account User (roles/iam.serviceAccountUser): Lets the service account act as itself