TL;DR - Can I authenticate to AutoML API by impersonating a service account (SA) with my application default credentials (ADC) or must I actually use SA authentication?
I would like to be able to authenticate to the AutoML API using ADC when making batch predictions on a deployed model. This is just for development purposes as to not create a new SA for each developer & data scientist. I know AutoML requires a SA for authentication so I would like to use the --impersonate-service-account flag or the auth/impersonate_service_account setting. I have followed instructions from this Medium post but am still getting an error about using end user credentials. So my question is, am I just doing something wrong, or must AutoML use a true SA authentication without impersonation?
The output of gcloud config list
is -
[auth]
impersonate_service_account = abcdefghijklmnop@my-project.iam.gserviceaccount.com
[compute]
region = us-east1
zone = us-east1-b
[core]
account = first.last@domain.com
disable_usage_reporting = False
project = my-project
Your active configuration is: [default]
Here is the error returned by AutoML -
google.api_core.exceptions.PermissionDenied: 403 Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the automl.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/.
And from the AutoML docs -
Service accounts are the only authentication option available with the AutoML API.
Thanks,
Zach