Would it be better to have gargle look in a different place for the auth file?
This comment solved my long-standing issues with authentication bigrquery and some cloudyr libraries for GCP.
https://github.com/r-lib/gargle/issues/138#issuecomment-716298851
Would it help if gargle looked for ....../gcloud/legacy_credentials/<user>/adc.json rather than ...../gcloud/application_default_credentials.json? Or, gave an error pointing to the workaround solution?
I'm not opposed to gargle looking in more places.
The intent of credentials_app_default() is:
Loads credentials from a file identified via a search strategy known as Application Default Credentials (ADC). The hope is to make auth "just work" for someone working on Google-provided infrastructure or who has used Google tooling to get started, such as the gcloud command line tool.
https://gargle.r-lib.org/reference/credentials_app_default.html
Therefore it would be very helpful to know if the path you are suggesting to add is documented anywhere. That would certainly lend weight to this idea.
(I haven't looked myself, because at the moment, I'm engaged in a time-limited triage before I do a quick patch release to fix an HTML5 issue that CRAN is cracking down on.)
From https://stackoverflow.com/a/63885193:
When you perform a
gcloud auth application-default logina JSON file is createdOn Windows, this is
%APPDATA%/gcloud/legacy_credentials/<USER_EMAIL>/adc.jsonOn other systems,$HOME/.config/gcloud/legacy_credentials/<USER_EMAIL>/adc.jsonIf you set yourGOOGLE_APPLICATION_CREDENTIALSto point to this user credential file, it works; the credential of the user will be used.If the users are the only one logged on their computer, you can also unset the env var. The same file will be automatically retrieved by the library (well-known location)