nlfiedler / enenra

Erlang/OTP library for Google Cloud Storage.
Other
7 stars 12 forks source link

User account or application default credentials? #8

Open pselden opened 5 years ago

pselden commented 5 years ago

Is there any way to allow user accounts or the application default credentials written by gcloud auth application-default login

The use case is for local development where I don't want to generate a service account key for each person who uses it.

The application default creds file looks like:

{
  "client_id": "752036041830-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com",
  "client_secret": "d-FL95D<snip>",
  "refresh_token": "1/Z8zEsJf8FrKXp<snip>",
  "type": "authorized_user"
}
nlfiedler commented 5 years ago

Not without some code changes, I think. At a minimum, get_auth_token() would need to learn how to authenticate using the credentials you've described. Probably the credentials record would need to be changed, as well as how the credentials are loaded.