peburrows / goth

Elixir package for Oauth authentication via Google Cloud APIs
http://hexdocs.pm/goth
MIT License
284 stars 108 forks source link

Configure goth with ADC service account #133

Closed gilbertobr closed 2 years ago

gilbertobr commented 2 years ago

I'm currently trying to use goth to authenticate with a "cloud run" service account.

Cloud Run uses "Application Default Credentials" .

From what I saw in the goth Readme, all the examples in application.ex ask to be passed a file or a json?

Could you provide a configuration example?

wojtekmach commented 2 years ago

If you have a service account you should take the credentials JSON and pass it to source: {:service_account, credentials, options}. We don't have support for ADC in the sense that we currently do not automatically look to known places for auth data. See https://github.com/peburrows/goth/issues/94. If you'd like to send a PR for that, it would definitely be appreciated! Closing for now.

wojtekmach commented 2 years ago

Just to be clear if you run into issues using goth with Cloud Run please let us know. It's just proper ADC support is not something we're planning tackle ourselves at the moment hence I've closed the issue.