-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fall back to gcloud session if application_default_credentials.json is invalid/expired #171
Comments
Somewhat related, on gcloud servers it is not uncommon to be logged in with a personal identity. As far as I know, there is no way to tell |
Hi there, the issue is that that "gcloud auth login" (for logging into gcloud SDK) is completely independent of "gcloud auth application-default login" (for generating ADC for other tools such as oauth2l and terraform etc.) If you'd like oauth2l to work with a non-stale ADC, you will have to run the latter command. FYI, "gcloud auth login" generates credentials in an internal gcloud DB that is inaccessible by other tools - this is somewhat by design. There had been some plans to make oauth2l self-sufficient by introducing an "oauth2l login" command, but that was never implemented. |
@andyrzhao ahh, i think i was slightly mistaken in my original report. The alternative to ADC creds wasnt a gcloud session, but rather a GCE instance service account. We use GCE instances for dev environments. Its not unusual to log into gcloud with a personal account on occasion, but most things use the instances service account. If there is a stale |
If
~/.config/gcloud/application_default_credentials.json
exists and is invalid, oauth2l will always fail, even if I log in to gcloud usinggcloud auth login
.This is quite annoying, since it is quite common for stale
~/.config/gcloud/application_default_credentials.json
to be hanging around (i.e. if I rangcloud auth login --update-adc
yesterday, but later logged in today without--update-adc
). In my company,application_default_credentials.json
that are fetched in this way expire relatively quickly (24 hours or less).It would be very convenient if
oauth2l
did some or all of the following:The text was updated successfully, but these errors were encountered: