The following command allows you to set your default credentials:
gcloud auth application-default login
It opens up a window (unless you use --no-launch-browser
) and allows you to connect your account. It creates a local json file that contains your credentials, which will be picked up when an application uses the Google Cloud SDK.
However, if I'd like to set my application credentials to a service account as follows:
gcloud auth application-default login \
--impersonate-service-account=saname@project.iam.gserviceaccount.com
This still allows me to authenticate in the browser, but it seems to load the credentials for my user account, not for the service account.
Is there anyway to achieve this? I.e., service account set as application default, without the need for a service account file.
Note: I do have the rights to impersonate the Service Account