googleapis / elixir-google-api

Elixir client libraries for accessing Google APIs.
https://hex.pm/users/google-cloud
Apache License 2.0
1.02k stars 460 forks source link

How can I leverage the default service account? #4330

Open Adzz opened 4 years ago

Adzz commented 4 years ago

In the app engine Docs it says things like:

Cloud Client Libraries will automatically find and use the service account credentials.

Is that true for this environment? I need to be able to leverage the default service account in a Flex env GAE app to make a query to an API on app start up.

dazuma commented 4 years ago

The Elixir libraries delegate to the Goth library for credential handling. Goth understands default account credentials (including those in the App Engine flexible environment) and will fetch them by default. See the "Making a Request" section in the readme of this repo for an example of using Goth to obtain credentials.

Adzz commented 4 years ago

Strange I couldn't get it to work at all. If I don't provide config goth seems to just error on start up.