Add logging to create_access_token_credential #991
Labels
auth
Issues related to the auth library
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
This is a small feature request. Feel free to close if not important/already planned/too hard/etc.
Is your feature request related to a problem? Please describe.
When auth doesn't work, error message is not always helpful: some error from HTTP service.
Turns out my local gcloud login expired. But at the time I was not even sure, that it actually used auth provided by gcloud command (file
~/.config/gcloud/application_default_credentials.json
).Describe the solution you'd like
Add debug statements how authentication was obtained, for example:
Ideally, produce error message not just with final http response, but also with information
gcloud auth login
gcloud auth application-default login
if something is expired and needs renewing(I am a new user of GCP, so don't know well how it works.)
Describe alternatives you've considered
Invoke
gcloud auth application-default print-access-token
command directly, or callhttps://metadata.google.internal/...
directly, as it is easier to debug.The text was updated successfully, but these errors were encountered: