Service Account vs Application Default Credentials vs API key

568 views
Skip to first unread message

Ronald Ruijs

unread,
Oct 20, 2017, 3:51:22 AM10/20/17
to Google Cloud Developers

Hello,

Trying to get Google Cloud Speech API to work for me, I have a few questions:

1. If I want multiple installations of my google-cloud-speech-enabled application to be billable separately, do I have to create separate Service Accounts, or would I use separate API Keys instead?

2. I could obtain an access token using Application Default Credentials, but I was unable to get an access token for a Service Account. How can I obtain an acces token for a Service Account?

3. Did anyone succeed in obtaining an access token for a Service Account? Documentation as available here was followed, but command "gcloud auth application-default print-access-token" resulted in error response for Service Account (did work after obtaining Application Default Credentials).

Thanks,

Ronald

Taher (Cloud Platform Support)

unread,
Oct 20, 2017, 4:41:26 PM10/20/17
to Google Cloud Developers

Hi Ronald,


For the first question, as you have multiple installations of google-cloud-speech-enabled application, I assume you also have separate VMs which are running them. You might consider adding separate projects with separate billing accounts associated with them which will have those VMs underneath them. The details of charges associated with Google Cloud Speech API can also be found in this article.


For the second and third questions, you should not be using application-default credentials from “gcloud auth application-default” to authenticate your service accounts. Instead, you should obtain and use a service account key as described in the article.


Reply all
Reply to author
Forward
0 new messages