peburrows / goth

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

example does not work. #117

Closed devalexandre closed 2 years ago

devalexandre commented 2 years ago

I tested the example shown in the readme, but even so it keeps giving error, is there any more complete documentation?

image

mix.exs

image

Error: image

wojtekmach commented 2 years ago

Note the crash happens in your Logger.info call. We cannot print maps as is. Change #{credentials} to #{inspect(credentials)} and same for source line below. Does that help?

devalexandre commented 2 years ago

Note the crash happens in your Logger.info call. We cannot print maps as is. Change #{credentials} to #{inspect(credentials)} and same for source line below. Does that help?

I remove a Logger. image

image

wojtekmach commented 2 years ago

I could see in the earlier stack trace that you had "type" => "authorized_user" in your credentials. The credentials must be for the service account. You can create them for example like this:

$ gcloud iam service-accounts keys create --key-file-type=json --iam-account=... credentials.json