google-gemini / generative-ai-python

The official Python library for the Google Gemini API
https://pypi.org/project/google-generativeai/
Apache License 2.0
1.47k stars 288 forks source link

ADC setup - Error 400: invalid_scope #296

Open abitrolly opened 5 months ago

abitrolly commented 5 months ago

Description of the bug:

Login with ADC fails.

gcloud auth application-default login --scopes="https://www.googleapis.com/auth/generative-language,https://www.googleapis.com/auth/cloud-platform"

What I did wrong?

Actual vs expected behavior:

image

Any other information you'd like to share?

No response

singhniraj08 commented 5 months ago

@abitrolly, I don't see client-id-file argument in gcloud auth application-default login command. Please follow Authentication with OAuth quickstart and let us know if you face any issues. Thank you!

abitrolly commented 5 months ago

@singhniraj08 why there should be the argument? Please explain. Without --scopes parameter the auth command successfully lands at https://cloud.google.com/sdk/auth_success

--scopes parameter was advised in https://github.com/google-gemini/generative-ai-python/issues/8