dart-archive / googleapis_auth

Obtain OAuth 2.0 credentials to access Google APIs
https://pub.dev/packages/googleapis_auth
BSD 3-Clause "New" or "Revised" License
38 stars 26 forks source link

Add ADC support #72

Closed jonasfj closed 4 years ago

jonasfj commented 4 years ago

Copying most of what the golang client is doing; https://godoc.org/golang.org/x/oauth2/google#FindDefaultCredentials

There might be some tricks around using the metadata set by gcloud auth application-default set-quota-project, see: https://cloud.google.com/sdk/gcloud/reference/auth/application-default/set-quota-project

But from what I can see, the golang doesn't have any special handling for this yet.

jonasfj commented 4 years ago

I did a bunch of refactoring to allow for minimal testing, and added support for gcloud auth application-default set-quota-project meta-data...